229 Open Daily games
2 Open Realtime games
    Pages:   1   (1 in total)
  1. #1 / 12
    Factory Worker Edward Nygma
    Rank
    Major
    Rank Posn
    #128
    Join Date
    Nov 09
    Location
    Posts
    1066

    I'm working on a game that has an intricate system of tracking units to determine where the unit died, then take that information, and make the unit spawn in one of 2 locations, based on where the unit died.

    Each player should always have 5 units on the board, and every territory has a maximum of 1 unit.

    To track units:

    I have the board divided into 2 sections, L(eft) and R(ight).  Each territory in R, is a continent that provides +1 AutoCapture factory to each of 5 territories; R1, R2, R3, R4, R5, each with a maximum of 1 unit.  Your capital is a -4 to R1, -3 to R2, -2 to R3, and -1 to R4 using AutoCapture factories as well.  Thus if you have 5 units in section R, then R1-R5 each have +5 to them, then the capital provides -4,-3,-2,-1 leaving them all with at least 1 unit, so all 5 light up.  If you have 3 units, only R3-5 light up, showing 3 units in section R.

    On the Left is a copy of that system for the second area.  So if you have 2 units in R and 3 units in L, then 2 of R light up and 3 of L light up.  I then have another 5 territories; R1O(ld), R2O, R3O, R4O, R5O, and the same for L.   Each turn the information from R1-5 copies over into R1O-R5O, so that you can see how many units you had in L and R last turn, and this turn.

     

    You now have 4 pieces of information. How many units you have in L this turn (A), how many units you had in L last turn (B), how many units you have in R this turn (C), and how many you had in R last turn (D).

    Then I need to find a way to take that information and either spawn a unit at base L or base R.  If a unit dies in L, respawn at L, if a unit dies in R, spawn at R.

    My current algorithm is incomplete... but it is as follows:

     

    IF       B > A 

    AND   B + D > A + C

    THEN   Spawn unit at base L.

     

    IF       C > D

    AND   B + D > A + C

    THEN Spawn a unit at base R

     

    This doesn't quite work for every situation though...

    Any ideas?

    http://www.wargear.net/boards/view/2886


  2. #2 / 12
    Shelley, not Moore Ozyman
    Rank
    Brigadier General
    Rank Posn
    #40
    Join Date
    Nov 09
    Location
    Posts
    3449

    What are the cases where you know it is incomplete?  It seems like it might not work when more than one unit dies on the same side in the same turn, but I'm not sure how this all shakes out in that case. 


    Also - I think instead of saying 'Riddle Me This', you should have a title to reflect your status as WarGear's resident mad genius.


  3. #3 / 12
    Standard Member Hugh
    Rank
    Lieutenant General
    Rank Posn
    #13
    Join Date
    Nov 09
    Location
    Posts
    869

    Are the troublesome situations the ones where an army crossed from L to R and then got killed? It seems like your algorithm should work for "ordinary" situations.

    Euler?? I hardly know her!

  4. #4 / 12
    Standard Member Hugh
    Rank
    Lieutenant General
    Rank Posn
    #13
    Join Date
    Nov 09
    Location
    Posts
    869

    Ozyman wrote:

    What are the cases where you know it is incomplete?  It seems like it might not work when more than one unit dies on the same side in the same turn, but I'm not sure how this all shakes out in that case. 

    It seems like it would at least detect the loss (B > A and B+D > A + C), but I guess there is only one base to put a unit, so that could be a problem. Or do the extras go to the jail??

    Euler?? I hardly know her!

  5. #5 / 12
    Factory Worker Edward Nygma
    Rank
    Major
    Rank Posn
    #128
    Join Date
    Nov 09
    Location
    Posts
    1066

    It has to do with turn delay...  If you lose 2 units in one turn... You had 5, now you have 3... that spawns a unit... so you had 3, now you had 4, nothing happens... now you have 4 and had 4... and so B+D is not greater than A+C... therefore you are stuck with 4 units...   Same thing happens with a jail break.

     

    I think I need to put in something like... If B+D = 4... then... something... If B+D=3... then ....  etc... but I can't wrap my mind around it.


  6. #6 / 12
    Factory Worker Edward Nygma
    Rank
    Major
    Rank Posn
    #128
    Join Date
    Nov 09
    Location
    Posts
    1066

    Ozyman wrote:


    Also - I think instead of saying 'Riddle Me This', you should have a title to reflect your status as WarGear's resident mad genius.

    Compared to the collective brainpower on this website... I'm far from WarGear's Mad Genius... but I did update it...


  7. #7 / 12
    Factory Worker Edward Nygma
    Rank
    Major
    Rank Posn
    #128
    Join Date
    Nov 09
    Location
    Posts
    1066

    Maybe I can say... if B+D = 1,2, or 3, Add 1 to B+D, so that the following turn you'll get another unit... it doesn't specify where the unit was... and it will never give you 6 units... but it might get stuck at 4 last turn, 4 this turn.


  8. #8 / 12
    Premium Member Kjeld
    Rank
    Major General
    Rank Posn
    #15
    Join Date
    Nov 09
    Location
    Posts
    1339

    How about this:

    First, every normal hex has the "jail" cell as its factory, for a -1 bonus. Normally, you'll have 5 units on the board for a total of -5 to that jail cell.

    Next, make the jail cell a +5 factory for the capital (and cap the jail at max 4 just to be safe). With all 5 units on the board, it will spawn none. Now, if you lose anywhere from 1-5 units on the board, that many will spawn in the jail on the next turn.

    Lastly, have a "jail break" territory, which when you capture it will allow you to fortify all units from the jail cell back to your base.

    The problem is that if you lose, say, 2 units on a given turn, the jail will spawn 2. If you don't get those units back on the board the next turn, it will spawn another 2. This opens the possibility for exploiting the jail to get more than 5 on the board. I haven't yet thought of a simple way to prevent this, but I'm sure there's some option.

    I suppose you could have a series of 4 "jail" cells, each with a max of 1 unit, and you could make the first the -5/+5 thing. The second would be -6/+5, with another +1 from the first jail cell (so that if you only had three units on the board, it would be -4/+5, yielding +1 for that cell). The 3rd cell would be -7/+5 with a +1 each from the 1st and 2nd jail cell, and so forth. Make them fortify back to 4 separate "spawn" points at the base, which each have the -1 factory, so you can't just grab the last cell and wait for the chain to spawn more units (either you have a unit on the board or in jail, with no other option). It seems to me that would work, with the only drawback being a delay in the spawning of your units in jail in the case where you lose multiple in one turn.

     


  9. #9 / 12
    Factory Worker Edward Nygma
    Rank
    Major
    Rank Posn
    #128
    Join Date
    Nov 09
    Location
    Posts
    1066

    The problem with 1 jail cell is that there's no difference between 1 unit and 5... it's 5 territories so that it can track 5 units that are still in jail.  You also can't fortify to an empty base... which has to stay empty or you will always have a unit to unleash on the board...

     

    Also a big part of the board is that you don't go to jail if you are killed in your own area.


  10. #10 / 12
    Premium Member Kjeld
    Rank
    Major General
    Rank Posn
    #15
    Join Date
    Nov 09
    Location
    Posts
    1339

    Yes, I realized that about the single jail cell. What about the second idea, though? It doesn't really get at the left/right side of the board thing, though I'm not really sure that's necessary for the map to work (i.e. I think it'd be fine if you went to jail no matter where you were captured).


  11. #11 / 12
    Brigadier General M57 M57 is offline now
    Standard Member M57
    Rank
    Brigadier General
    Rank Posn
    #73
    Join Date
    Apr 10
    Location
    Posts
    5083

    Kjeld wrote:

    Yes, I realized that about the single jail cell. What about the second idea, though? It doesn't really get at the left/right side of the board thing, though I'm not really sure that's necessary for the map to work (i.e. I think it'd be fine if you went to jail no matter where you were captured).

    This is an interesting idea -- though it wouldn't emulate the way the game is played in RL as much , and it would force more aggressive play.  Having the river and mountains delineating home/safe zones worked pretty well (I played a few test games with Ed).

    It should be possible to play WG boards in real-time ..without the wait, regardless of how many are playing.
    https://sites.google.com/site/m57sengine/home

  12. #12 / 12
    Factory Worker Edward Nygma
    Rank
    Major
    Rank Posn
    #128
    Join Date
    Nov 09
    Location
    Posts
    1066

    If there's a better solution I want to go with it... but it has crossed my mind to just send a unit to base whenever you don't have 5 units...  I could say if you own the same number of units this turn as you did last, and your total units is less than ten, then spawn a unit at base...  

     

    I'm trying to find a set of comparisons that will correct the current sequence in place, fixing everything beautifully... and I'm still convinced it exists.  Tracking works, comparing works... I just need the right sequence of comparisons so that you always get the unit you're supposed to get where and when you're supposed to get it.


You need to log in to reply to this thread   Login | Join
 
Pages:   1   (1 in total)