Android-Netrunner-OCTGN icon indicating copy to clipboard operation
Android-Netrunner-OCTGN copied to clipboard

Assign cards to servers

Open db0 opened this issue 13 years ago • 6 comments
trafficstars

I need to build the system to assign ice, asstets, upgrades and agendas to a server. This will allow me to automate the placing of a card, under/over its respective server, take extra costs for installing more than 1 ice on the server, prevent the player from installing more than 1 asset/agenda on the same server, and allow effects like Akitaro's to work automatically.

db0 avatar Sep 18 '12 14:09 db0

Just doing a brief pass, I was thinking about this and figured I'd put some note stuff here that bounced around in my head.

Asset/Agenda onInstall:InstallToServerBase

Upgrade onInstall:InstallToServerBase-isOptional||onInstall:InstallToServer

ICE onInstall:InstallToServerDefense

Gameplay Implications:

  1. Users would need to explicitly create Remote Servers now (but they should be doing this anyways, this is a gameplay mechanic.)

  2. Setup phase should automatically make three special servers for HQ, RND, and Archives.

  3. Per gameplay rules, ICE can technically only be trashed when installing to that server. Instead, maybe we can just assume that the players are smart enough to manually trash ice before installing new pieces. The cost reduction should happen automatically, so we just have to trust that players aren't just deleting ice for the fun of it.

ignisphaseone avatar Dec 18 '12 19:12 ignisphaseone

I actually have already a working concept in my head on how to handle it and it would avoid having to add a bunch of extra keywords on almost all corp cards. Those keywords are not needed anyway since they're always the same for each type of card.

It's going to work via dictionaries, where each ice and agenda is assigned in the backend to a specific server. This will allow the game to correctly place each card to its server and also take into account the extra costs of each ice.

I already have a working attachment code for SW:LCG. Once I'm finished with that, I'll probably port that to A:NR and tweak it to become the server assignment code. You can already check it out however in the SW:LCG repo. Check the Enhancement attachment code and the card capture code (function capture())

In A:NR it's going to work a bit differently. When you are clicking to play a card, the game will first check if you've got a remote server targeted. If you do, it will immediately play the card on that one. If you don't it will pop-up a singeChoice() menu and ask which server of the available ones to play to. The last of the options will be to play it on a new remote server. This will ensure that players will not be able to play a non-operation card without assigning it to a server and it will also avoid them having to manually create remote servers as well.

This will allow the game will also keep track if you've got assets/agendas on a server and rules-enforce the "no-more-than-one" restriction. It will also be able to keep track of how many ice you have, place them correctly and increase your costs.

Once this code is ready, I'll be able to use the server-attachment dictionary to try to script runs a bit.

db0 avatar Dec 18 '12 19:12 db0

I think implementing this would also make it fairly trivial to allow F3 to access remote servers as well. The current method is a little confusing for first time users and it probably took me a good 3 or 4 games before I got it completely worked out.

DreadPirateLynx avatar Jun 18 '13 06:06 DreadPirateLynx

Yeah, I know. It's just a bunch of work and I need to find the motivation for it. :-/

db0 avatar Jun 18 '13 06:06 db0

Here's an idea on how to detect ices orders in servers...

Let's assume the board table got X and Y coordinates to display the cards.

Horizontal cards are ices.

Let's assume servers icons got X and Y placements to display the servers.

Let's ignore the fact that you can put servers in front of other for the moment (that is the problem).

Let's calculate all X and Y center coordinates of ices and servers icons.

1 - For each server calculate (X server) - X (other server) to determine the server order (which one is next to which one, the two minimum are next to each other, the sign determine left and rigth server). Put results in a 2d tab. 2 - For each ice, calculate abs(X(center of ice) - X(center of each server)). The minimum of each number means that ice is put on this server. Construct a tab with this ice and the server (enhance 2d tab in 3d tab maybe) 3 - For each column in 2 with ices, order ices by Y position => voila you got a tab for each server...

==> then you can maybe automatize Chum (you would need to know if an ice is broken or not), Caïssa things and so on.

Dalmadog avatar Dec 07 '13 09:12 Dalmadog

To start with a really small side issue: Couldn't the game just create a bunch of empty servers for the corp on setup? Is there any downside to doing that?

w0nk0 avatar Jan 16 '14 00:01 w0nk0