Making a RTS based on Game of Life

For general discussion about Conway's Game of Life.
Chesstiger2612
Posts: 15
Joined: August 14th, 2013, 1:28 pm

Making a RTS based on Game of Life

Post by Chesstiger2612 » August 14th, 2013, 3:27 pm

Well, in the next 2 weeks I will be away in holidays without access to a computer, so I thought I need sth. to invest my time in. I don't know where exactly the idea came from, but since I am a fan of both Game of Life and RTS-Games, why don't make such a game out of it.
The basic idea was having a field of X x X squares that is divided like this. I just take 256x256 as example since it is complicated using x/2xx/2 or x/3xx/6 and other stuff all the time. The center 128x128 is the place where the battle takes place. There are 2 factions and they have a space of 128x48 each to build on, with 128x32 battleground in the midth. The outer 64 squares in each direction are for bonus space that the things you build in your 128x48 will need maybe for "factory"-like cell complexes. This outer 64 squares in each direction have a wall in the middle because this is not where the "fight" should take place. Then there was the idea of different types of cells. The king cell is at the last line of your building area, if it is next to an opponent's cell you lose. There should be a forward cell that just moves forward and sth like a basic cell that behaves like QuickLife or HighLife cells (dunno which is better for my purposes). There should be several different cell types like "Warrior" Cells, "Detonation" Cells and so on but my idea hasn't progressed that much so I want to discuss that later. In the fighting system, every cell has a strength number. Maybe 2 for forward cells, 3 for basic and so on. Now every turn for a cell that is in fighting mode you calculate like this if the cell keeps living or dies. You look at all enemy cells attacking you and check if they are attacked by one of your cells. Lets say your cell, which has strength 4, is attacked by 2 opponent cells. One of those isn't attacked and has 2 strength. The other one has 3 strength but is also attacked by an ally cell with strength 2. Now the attacking points of the second enemy cell is 3-2=1 (it obviously can't go under zero), and the attacking points on the other enemy cell is 2. 2+1=3 so there are 3 attacking points against you. Your cell's strength is 4 so you have 4 defensive points and your cell survives. With same attack and defense points the cell would die to avoid stalemate situations. I would suggest the game is played with between 1 and 2 moves per second, and you have a certain number of pauses within the game to coordinate a complex change in your move. Then there should be resources that you will get when specific cell combinations occur. You should be able to build "factories" but they shouldn't provide them fast OR are expensive to build themselves. You should also get starting resources and a little bit of resource per time/move. Obviously, the game would be very complex and probably completely unbalanced but there are so many possibility and it will be impossible to react best always, so new strategies won't get out that fast. I like the idea that you have actually to think strategical and the skillcap would be very high if it turns out as I hope. Please give me some feedback, new ideas, say if you think the idea is stupid, OK or brilliant, and give relevant critics please. I am open for everything :) Thank you in advance

Chesstiger2612
Posts: 15
Joined: August 14th, 2013, 1:28 pm

Re: Making a RTS based on Game of Life

Post by Chesstiger2612 » August 14th, 2013, 3:48 pm

Oh, I forgot something, I was talking about "fighting mode" without really explaining it. If a cell is next to an enemy cell, this cell and ALL CONNECTED CELLS (means if you have a line of 20 cells all of them are in fighting mode) are set in fighting mode, in this mode they don't behave like they normally do, so they aren't regarded as cells in terms of creating other cells and don't die even the normal living conditions are not the case any more. As soon as they aren't "connected" with an enemy cell directly or indirectly any more they aren't in the fighting mode any more. This is helpful because one little enemy block could destroy a complex machine otherway because some cells of it are in fighting mode and the other ones aren't and they get out of sync and destroy your whole base (for complexes that are divided in different parts which aren't connected there could be maybe a block you can set that does nothing but connect). If you move with some cells to an enemy's factory-system you could also do economical harass with keeping them in fighting mode so they aren't producing even if you don't manage to kill any cells. If you have any questions, feel free to ask.

Chesstiger2612
Posts: 15
Joined: August 14th, 2013, 1:28 pm

Re: Making a RTS based on Game of Life

Post by Chesstiger2612 » August 15th, 2013, 10:14 am

OK, some more ideas:
You can only build on the area you scouted, and every of your cell gets a line of sight, and you get scouting cells that have slightly strength and much more line of sight. These can't be bought so you have to build complexes that spawn them: In Standard Game Of Life, a cell spawns when 3 of the 8 squares around them are also populated. I think they would spawn inflationary then so you should have a specific combination, maybe sth like at the 4 corners. For the scouting cells, I have two different ideas of movement: The first is moving like a culture with groups of cells and birth and die-rules, like the Game of Life "basic" cells. The other one is that you have a single cell that "gets moved" dued to other cells around it, e.g. there was a forward cell left to it, then this forward cell dissolves and the scouting cell moves right, it in a way gave the energy for the scouting cell. I am not really sure which of these principles makes more sense but I tend to say the first one because they should be moving fast and with the second principle you need a complex that forms a stream of forward cells to push them. So for the scouting cells other cells around them like Game of Life cells and forward cells should influence their direction and their movement so they don't move "randomly" or not predictable. The rules used for this should allow fast movement. The principle of a solid cell that doesn't move itself but gets pushed may be an idea for some cells that are warrior-like but not the fastest, aswell as for explosion-type demolition cells (for them you could maybe push them with forward cells and activate them with a Game Of Life cell) or sth. These hardly moving objects should be bought not synthesized. Also cells that you buy would be sth like a mine which is hidden, never moves, and explodes when an enemy cell would spawn on it, and a tower cell, that has a range of 2 or 3 squares and picks off every object in range but then has a cooldown of ca. 5 moves. The idea is to use them to control unpredictable Game Of Life-cell development (also your own cells) that shouldn't turn against your own base and make everything to not work anymore. The other idea is to protect your resource-factories, eco-machines or however you want to call your resourcegathering complexes, from simple, uncontinuous dangers, like enemy scouting cells going in or from "warrior" cells or how I want to call them. Names don't really matter at this point. My other new idea was a socalled Combinatory Cell, that is also bought, can't fight and there are special combinations for a empty square for combinations to new cells or an easier way to resource. Lets say on the eight squares around an empty cell was 1 combinatory cell, 1 forward cell and 1 Game of Life cell and the combination rules (which of course aren't made yet) would say this spawns a resource cell which will dissolve next turn for an extra resourcepoint stockpiled. In this case the educts but the combinatory cell would dissolve. For products which have more worth like some elite-fighter cells or supporting cells or I don't know the combinatory cell should dissolve to and work in this case as a true educt, normally the idea of the combinatory cell is more equivalent to a catalyst. Enough for today, I hope this project will lead to sth. I appreciate feedback and as always, thank you in advance :) .

User avatar
Extrementhusiast
Posts: 1966
Joined: June 16th, 2009, 11:24 pm
Location: USA

Re: Making a RTS based on Game of Life

Post by Extrementhusiast » August 16th, 2013, 7:26 pm

I can imagine that a rule like Star Wars (B2/S345/C4) or a nearby rule would work better for this sort of thing.
I Like My Heisenburps! (and others)

User avatar
KDB
Posts: 4
Joined: August 22nd, 2013, 4:21 pm
Location: Washington DC

Re: Making a RTS based on Game of Life

Post by KDB » August 22nd, 2013, 5:04 pm

I have been doing something sort of like this for about the last week.
Using a very small, 50x50 cell screen I simply divided it in half and put a block in two opposite corners to represent the "home base" of two players. The game ends when one home base is destroyed.
Each player is then allowed to place a certain number of cells as stilllifes and oscillators for defensive purposes and another number to make spaceships, so far only gliders, to throw at each other’s home base.
On the 50x50 cell game board I was using 20 defensive cells and 10 offensives.
If both sides survived until everything stabilized then the game is paused and each side placed another two gliders. In about 40 or 50 trials I never had to go to a 3rd round of placing gliders.

Now, I first saw Conway’s game as a beginner's programming exercise back when 32 KB was a lot of RAM but I just started playing with it again and am so unfamiliar that with the rules described above it was pretty much a game of chance; seldom has one side won because a strategy worked it was always just unforeseen results. It was usually just your own defenses blowing up on you.

However, with different kinds of cells following different rules like Chesstiger2612 is doing I think it can be done.

I'm new here (first post) but I would be happy to work on a collaborative effort to make something like this work.

User avatar
KDB
Posts: 4
Joined: August 22nd, 2013, 4:21 pm
Location: Washington DC

Re: Making a RTS based on Game of Life

Post by KDB » August 22nd, 2013, 5:41 pm

Chesstiger,
Another thought I had that might also work for the direction you are going is that players must "Grow" the cells they use; starting with some seed cells a farm area, maybe inside your construction area, is dedicated to suppling cells for the war effort. when a player needs cells to construct something he harvests them from his farm area.

Question: perfect information game? do players see each other's construction areas?

I also think "between 1 and 2 moves per second" is awfully fast. You must be a speed Chesstiger. You will get deeper, more thoughtful and insightful stragety out of the players if the game only advances to the next generation only when both players agree to it. At least at first; this game is going to have to be around for a while before anyone gets good at it.

User avatar
KDB
Posts: 4
Joined: August 22nd, 2013, 4:21 pm
Location: Washington DC

Re: Making a RTS based on Game of Life

Post by KDB » August 23rd, 2013, 5:21 pm


Chesstiger2612
Posts: 15
Joined: August 14th, 2013, 1:28 pm

Re: Making a RTS based on Game of Life

Post by Chesstiger2612 » August 31st, 2013, 1:05 pm

Hi KDB,
sorry for not replying this long, I was on vacation for two weeks and I had no access to a computer. So I'm back now (yay) and if you want you can help to realize this project. First, your ideas about other rules are legit, you can't build your main army out of S23B3 because they aren't controllable enough. But I think these Basis-Cells or however I might call them in the end which are S23B3 are important because they characterize the Standard Game of Life. I think the main use of them is building up eco, gun/cannon machinery or interact with other cells (so e.g. a other-type-cell's rules are changed when a S23B3 cell is around). One problem of my idea was that a complex of cells could probably ruin your whole base if one cell is at a different place :D . So I thought we might add rules that react to the relative postition so they don't move backwards for example. An example
F=In Front FL=Front Left FR=Front Right L=Left R=Right B=Back BL=Back Left BR=Right
Birth: 3[F,FL,FR]
Survive: 2[all], 3[all]
Then improve this idea with the possibility to link with AND and ORs, like in informatics. It would sadly take away some of the simplicity of the basic idea, but it would improve the game and would make it also controllable for a human. In addition, you don't need to give all celltypes the complex rules, just a few which are made for raiding and combat so they don't block your whole eco and go to the enemy quickly. I have some nice ideas (although they have to be improved) for the Scouting Cell regarding this, I will post it in the next hours.

Chesstiger2612
Posts: 15
Joined: August 14th, 2013, 1:28 pm

Re: Making a RTS based on Game of Life

Post by Chesstiger2612 » August 31st, 2013, 5:06 pm

So my initial idea for the scouting cells was:

B:(3[B,BL,BR,L,R]&&3[all])||(3[B,BL,BR]&&3[all])||(2[B,BL,BR,L,R]&&2[all])||(2[B,BL,BR]&&2[all])||(4[F,FL,FR,L,R]&&4[all])

S: I wasn't sure if S23 or S234 is better. For now I managed it with declaring a cell with 4 neighbours becomes sick which means it will die next generation no matter what and then dissolve after 2 generations instead of die instantly and dissolve after 1 generation.

The 2x2 cube would result in an oscillator and the 3V (or pre-block) would go forward wildly (like scouting cells should do). If their strength value is low enough and the resource you have to pay high enough this would work out well but I am not 100% OK with the scouting cell rules because they benefit structures with 3-4 cells and in my opinion a rule would be best with which you can trigger simple behaviour with 3-5 and complex scouting with 6-8 cell patterns.

Chesstiger2612
Posts: 15
Joined: August 14th, 2013, 1:28 pm

Re: Making a RTS based on Game of Life

Post by Chesstiger2612 » August 31st, 2013, 5:53 pm

KDB wrote:Chesstiger,
Another thought I had that might also work for the direction you are going is that players must "Grow" the cells they use; starting with some seed cells a farm area, maybe inside your construction area, is dedicated to suppling cells for the war effort. when a player needs cells to construct something he harvests them from his farm area.

Question: perfect information game? do players see each other's construction areas?

I also think "between 1 and 2 moves per second" is awfully fast. You must be a speed Chesstiger. You will get deeper, more thoughtful and insightful stragety out of the players if the game only advances to the next generation only when both players agree to it. At least at first; this game is going to have to be around for a while before anyone gets good at it.
I thought you have a non-perfect information game, scouting shouldn't be too hard but important. I thought all cells can be syntethized, like 1 of this cell type and 3 of this cell type as neighbors allow a specific cell to appear. I planned not to use a worker/builder system because it wouldn't fit in the game, so most cells can be bought and syntethized, some can only be built or syntethized. For building your cells you have a special area which is defined by following factors:a certain rectangle which gets bigger the more resource you gathered over the game as maximum line, then every living cell provides a "line of build area" which is similar to the "line of sight" but a bit smaller. Then an opponent cell near should negate you can build on a square, cause its stupid if you can directly respond to an enemy force with putting your cells nearby without the opponent has any chance. That would ruin offensive game. So there was the idea of a "line of threat", which is similar to, yes you guessed it :D , line of sight and line of build area. The harvest idea though is a good one I will think about it maybe good for your first army cells where you haven't enough to massproduce them but, as mentioned, just placing would be awkward. Regarding speed you are probably right, that is awfully fast, but first I thought you have to make it so fast, otherwise the games would last days. But at that point of time I wasn't aware of a board (or battlefield or whatever) which is "expanding" (yeah, i know, only the area you can use is really expanding) with your incoming resources and can obtain a balance between early attacks and the fact cool late-game complexes need huge amounts of space, especially tuned factories for your best warriors, I imagine. So it is best to start with both being ready and move on to a certain speed before the next move starts when the game developes further (because it should be Real Time Strategy=RTS not turn-based :) ). Of course everybody likes other game speeds, so you should have the option to set different game speeds before the actual game. Thanks for helping me and good luck with your creativity :D ,
Chesstiger2612

TWLife
Posts: 57
Joined: August 30th, 2013, 8:12 pm

Re: Making a RTS based on Game of Life

Post by TWLife » September 1st, 2013, 1:51 am

Well, have a look at these rules I found for attacking purposes.... every cell on the grid doesn't all have to have one rule does it?
5678/234/5:T512,512
35678/24/5:T512,512
Its just that I can't find anything that stablizes with the second rule, only squares, but they emit 'bullets' as well, also I found that with the second rule if you draw a line 2 squares thick across the whole grid, it acts like a barrier, there's just no way to get rid of it though......( you can also construct barriers with certain patterns and they end up stretching themselves across the whole grid)(Tip for second rule: try drawing solid rectangles... and squares...)

Chesstiger2612
Posts: 15
Joined: August 14th, 2013, 1:28 pm

Re: Making a RTS based on Game of Life

Post by Chesstiger2612 » September 1st, 2013, 6:00 am

TWLife wrote:Well, have a look at these rules I found for attacking purposes.... every cell on the grid doesn't all have to have one rule does it?
5678/234/5:T512,512
35678/24/5:T512,512
Its just that I can't find anything that stablizes with the second rule, only squares, but they emit 'bullets' as well, also I found that with the second rule if you draw a line 2 squares thick across the whole grid, it acts like a barrier, there's just no way to get rid of it though......( you can also construct barriers with certain patterns and they end up stretching themselves across the whole grid)(Tip for second rule: try drawing solid rectangles... and squares...)
You are right about the rules, my idea was to give different cells different rules. Sorry for the noob question, but what do the symbols after the second '/' mean? I only worked with [Survive]/[Birth] yet. A projectile-emitting rule would be fine, would fit best to a mid-game fighting cell, I think. As mentioned before, I also wanted to implement a S23/B3 cell that is mainly for eco, building guns etc. up and maybe early-game fighting. If you place 2x2 cubes next to each other, you could also create barriers. Every cell coming in gets attacked by two S23/B3 cells, so that is a good early game wall
B=Basic Cell (S23/B3)
-=no cell
BB-BB-BB-BB ...
BB-BB-BB-BB ... <--- example for an early-game wall

Chesstiger2612
Posts: 15
Joined: August 14th, 2013, 1:28 pm

Re: Making a RTS based on Game of Life

Post by Chesstiger2612 » September 1st, 2013, 6:13 am

By the way I wanted to make a change for the fighting system after some testing.
OLD: (your cell's strength)-((attacker 1's strength)-(ally cells [cell first mentioned NOT included] attacking attacker 1)[this bracket's result is minimum 0])-((attacker 2's strength)-(ally cells [cell first mentioned NOT included] attacking attacker 1)[this bracket's result is minimum 0])... and so on
After a bit of testing the result was that in a big fight only the cells at the corners died and the fighting results sometimes didn't seem to be realistic. So I concluded it would be better to reduce your ally's influences on 1/2 so that a cell that is attacked by another with same strength can nonetheless deal damage to another cell. So the awful looking formula would now be :D :
OLD: (your cell's strength)-((attacker 1's strength)-((1/2)*ally cells [cell first mentioned NOT included] attacking attacker 1)[this bracket's result is minimum 0])-((attacker 2's strength)-((1/2)*ally cells [cell first mentioned NOT included] attacking attacker 1)[this bracket's result is minimum 0])... and so on

TWLife
Posts: 57
Joined: August 30th, 2013, 8:12 pm

Re: Making a RTS based on Game of Life

Post by TWLife » September 4th, 2013, 1:37 am

the last '/' means how many generations a cell will take up once it dies when you subtract it by 2/however many different types of cells there are (1=dead, 2=alive, 3=fading, 4=fading more, 5=fading even more)

Chesstiger2612
Posts: 15
Joined: August 14th, 2013, 1:28 pm

Re: Making a RTS based on Game of Life

Post by Chesstiger2612 » September 5th, 2013, 9:22 am

TWLife wrote:the last '/' means how many generations a cell will take up once it dies when you subtract it by 2/however many different types of cells there are (1=dead, 2=alive, 3=fading, 4=fading more, 5=fading even more)
OK thank you very much

User avatar
KDB
Posts: 4
Joined: August 22nd, 2013, 4:21 pm
Location: Washington DC

Re: Making a RTS based on Game of Life

Post by KDB » September 27th, 2013, 6:57 pm

Chesstiger2612: Check your private messages.

Chesstiger2612
Posts: 15
Joined: August 14th, 2013, 1:28 pm

Re: Making a RTS based on Game of Life

Post by Chesstiger2612 » September 28th, 2013, 6:37 am

KDB wrote:Chesstiger2612: Check your private messages.
Oh sry :D Thx for reminding

7yl4r
Posts: 8
Joined: August 30th, 2013, 1:14 am

Re: Making a RTS based on Game of Life

Post by 7yl4r » September 30th, 2013, 2:51 pm

This sounds epicly cool. Do you have any source code you would share?

Chesstiger2612
Posts: 15
Joined: August 14th, 2013, 1:28 pm

Re: Making a RTS based on Game of Life

Post by Chesstiger2612 » September 30th, 2013, 3:52 pm

7yl4r wrote:This sounds epicly cool. Do you have any source code you would share?
I am still in the idea phase if there is one I will post it in the forum

7yl4r
Posts: 8
Joined: August 30th, 2013, 1:14 am

Re: Making a RTS based on Game of Life

Post by 7yl4r » September 30th, 2013, 4:26 pm

Chesstiger2612 wrote:
7yl4r wrote:This sounds epicly cool. Do you have any source code you would share?
I am still in the idea phase if there is one I will post it in the forum
yes please. I could help code if I feel the need to procrastinate and you wouldn't mind. I've been an RTS and GoL fan for years... since I was 8 I think.

What are your plans, technically? I've seen some decent GoL implementations in javascript which you might be able to leverage for a web app.

Chesstiger2612
Posts: 15
Joined: August 14th, 2013, 1:28 pm

Re: Making a RTS based on Game of Life

Post by Chesstiger2612 » October 1st, 2013, 10:18 am

7yl4r wrote:
Chesstiger2612 wrote:
7yl4r wrote:This sounds epicly cool. Do you have any source code you would share?
I am still in the idea phase if there is one I will post it in the forum
yes please. I could help code if I feel the need to procrastinate and you wouldn't mind. I've been an RTS and GoL fan for years... since I was 8 I think.

What are your plans, technically? I've seen some decent GoL implementations in javascript which you might be able to leverage for a web app.
Yesterday I asked one of my friends who knows very much about programming to help so in a few weeks there may be a program where we can test different cell types and their rules also interfering with each other. I have precise ideas for a few ones, but need a program to test others. I think this friend of mine will decide to run it not on javascript but on an other programming language because when you have iterative calculations for a whole board it may lag more than e.g. C++ but thats his decision. If you have ideas yourself, feel free to post them since I am always open to new suggestions :D

7yl4r
Posts: 8
Joined: August 30th, 2013, 1:14 am

Re: Making a RTS based on Game of Life

Post by 7yl4r » October 3rd, 2013, 6:15 pm

Chesstiger2612 wrote:
7yl4r wrote: What are your plans, technically? I've seen some decent GoL implementations in javascript which you might be able to leverage for a web app.
Yesterday I asked one of my friends who knows very much about programming to help so in a few weeks there may be a program where we can test different cell types and their rules also interfering with each other. I have precise ideas for a few ones, but need a program to test others. I think this friend of mine will decide to run it not on javascript but on an other programming language because when you have iterative calculations for a whole board it may lag more than e.g. C++ but thats his decision. If you have ideas yourself, feel free to post them since I am always open to new suggestions :D
Well I am very flexible when it comes to language choice. Just let us know what your friend comes up with so I can check it out! =)

Chesstiger2612
Posts: 15
Joined: August 14th, 2013, 1:28 pm

Re: Making a RTS based on Game of Life

Post by Chesstiger2612 » November 28th, 2013, 4:52 pm

Doesn't really get forward :/, if you have an idea to program sth that would help developing the game feel free to start, because I'm not good at programming.

7yl4r
Posts: 8
Joined: August 30th, 2013, 1:14 am

Re: Making a RTS based on Game of Life

Post by 7yl4r » December 1st, 2013, 2:21 am

Chesstiger2612 wrote:Doesn't really get forward :/, if you have an idea to program sth that would help developing the game feel free to start, because I'm not good at programming.
Bummer. I'd love to work on it, but I don't think I have the time to lead development. We need to brew the gameplay concepts a bit more and search for some more potential collaborators. I think you need low-fidelity mockups of gameplay even more than programming right now.

User avatar
Extrementhusiast
Posts: 1966
Joined: June 16th, 2009, 11:24 pm
Location: USA

Re: Making a RTS based on Game of Life

Post by Extrementhusiast » December 1st, 2013, 6:19 pm

I'll just leave this here.
I Like My Heisenburps! (and others)

Post Reply