Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Procedural RTS thingy

So I am toying with the idea of making an RTS with a lot of procedural asset generation. I am thinking I would like to make as much of it as possible be generated at runtime, so even though it will be really low detail and all, it should still be interesting to look at. I would like to do things like make even the trees drawn by the game different for each tree so those won't get repetitive. I am thinking of trying to do something similar with music as well.

So below I have an image that's got a few things going on, it's basically just a brainstorm of some different things. This is at night, which is why the background is black. You can see a few guys there, one of them is walking back towards the building (I guess with some logs from cutting down trees, but I don't have a way to show that yet). Another guy is cutting down a tree, those speckles are to show action, they would be moving in game. Next to the trees are some tree stumps for trees that were already cut down. Below the building is a torch, so you can see what the ground would look like in the day time. This is obviously pretty messy, but I am just getting some ideas down. The art would look more or less like this, though, with the really low detail stuff.



The default zoom level would be 4x, although you could zoom in and out in powers of two. Just in case your browser farts on the imgzoom and smooths it out, here's the same thing at 4x:

fnfgc6.png

As far as gameplay goes, I would like the building and development aspects to be more indepth than something like Command and Conquer. It would be similar to Rise of Nations or Age of Empires I where you would go through different eras or ages of technology. Not sure how many I would have, but I am thinking that the first age would be before any real military, so you can probably only have regular citizens or maybe citizens and hunters. Probably in some sort of iron age is when you would be able to build military units.

There would of course be a gunpowder age where you get simple guns and cannons and such. Cannons would probably be a mobile unit that takes 3 civilians to make (To make a cannon, you would send 3 civilians to whichever building makes cannons, and then those 3 civilians would become the cannoneers). Before cannons might be a catapualt or trebuchet, and that might not be mobile. After cannons might be a priest artillery or something like that that is even more mobile and has a farther range.

Some ages would also give certain unit types special bonuses. Somewhere around an industrial age or something like that would let citizens turn into militiamen and they would be able to be strong fighters while still being able to do citizen tasks (building, gathering, etc.)

I would like to do something with night vs day like maybe different animals will spawn at different times. I would also like to make different animals spawn in different ages. That way, while you likely would not have to worry about attack from another civilization early on, you would have to worry about a sabertooth tiger or mastadon. As you progess through the ages, those animals might change to wolves and elephants (I am not really concerned with making the newer animals the eveolutionary decendents of older animals lol) and then eventually it would turn out that not many wild animals spawn near your cities.

Something that would interest me is trying to make it a multi-faceted game where you can focus on building cities, and it would be something like city life, or you can focus on the fighting and interacting with other nations. Not sure yet how I would work that out, so it's just an idea.

I'll keep thinking and try to get more images, but in the meantime if I can get some C&C (Not command & conquer :P) that would be great!

EDIT: Oh yeah, I should probably say it if it isn't clear, but the images above are just mockups :P
 
Ok, so I am toying around with different character sizes, because I realized I probably can't make the units look diverse enough with the size I had before. The grass is still ugly, but I am thinking that I personally like the way it looks, even though it's ugly, for the retro cabinet arcade feel. If you guys like totally hate the grass, let me know please!



Because of the new character size, the default zoom would probably be 2x instead:

2wcpnuu.png

Those ones will probably not be used since it's hard to see what's going on in them, they are just some test sprites.

I gave some more thought to the ages and I am thinking it should be like this:


  • Stone Age
  • Paleolithic (Stone tools, would be only citizens and hunters)
  • Mesolithic (Adds farming)
  • Neolithic (Adds first military unit, probably dudes with spears)


  • Metal Age
  • Iron (Metal tools and weapons, dudes with spears become lancers with... lances. You can also make soldiers with swords, archers with bows)
  • Steel (Ups the strength and defense of units, you can also begin to make your first artillery unit (trebuchets and/or catapults) you can also make cavalry now)


  • Industrial age
  • Gunpowder age (lancers become fire lancers, archers can shoot flaming arrows, soldiers and cavalry get increased power and defense. Inter-city commerce is now possible with caravans and the advent of a standard currency. This will create a way for you to make money without looking for gold anymore. Gold's only use at this point will be selling it for more money.)
  • Age of the gun (Archers and fire lancers both become musketeers. Cavalry has flintlock pistol instead of melee. Soldier has flintlock pistol in addition to sword. The flintlock pistol can be fired more rapidly than the musket, but does less damage.)
  • Steam Age (Inter-city commerce is now faster with the addition of steam locomotives. You can also use the trains to send units quickly from place to place.)

I haven't decided yet where I will go from there, and I may decide to do more or less than what is here, still just playing with ideas.

C&C appreciated.
 
i like this idea alot! :D i dont think the making them look random will be hard if you arnt using alot of detail, ive written several scripts that call get_pixel and set_pixel over and over (my alpha mask script and my custom image file format script) its just a matter of optimizing your code(im sure you are a better programmer then me just want to add my two bits). i think the hard part will be all the interactions with the mouse, i always tend to have issues there. i miss those old graphics like the ones you have, and rts like that. i would like to watch you develop this
 
Glad you like it :D

If I decide to actually make this (I am just exploring the idea right now) then I will either set up a blog or make a thread here for it and keep it updated. For now, I will just be adding stuff to here every once in a while.

I don't think I will have too much problem with the mouse stuff. I think the two most challenging parts will be trying to write an automatic music composer (lol) and then the AI, because I want to spend extra time with the AI and make it cool.
 
OK, so this is actually the first image I made when I was trying to get something down. I can't decide between the 3 styles for the grass/terrain that I have now, but I am thinking it is between this one and the first image that I actually posted.



There's some partly finished water there too, all I have is the shoreline though. Some sand is there as well.
 
That's the one that I like the most too. Today I prototyped an algorithm to generate that procedurally. Turns out spamming random pixels is pretty close to getting that lol. I will play around with it some more and probably soon post some shots of terrain generated in RMXP. I am using RMXP for prototyping, but the actual game would be in C++/OpenGL, so it would be for Windows and Linux probably.
 
Ok, so here is a side by side comparison of two possible algorithms for generating the grass texture.

qsp43m.png


Which looks better, are they both good, both terrible?
 
lol well, I actually hate them both haha.

However, I just came up with this and I personally like this one a lot, what do you think?

2wfqwwh.png
 
lol, funny thing is, that last algorithm borrows a lot of the concept from MS Paint's spray can tool. I can, of course, adjust the colors as necessary. I am more concerned with shape for the moment. The first test for each of these algorithms just did white on black lol.
 
Sephiron":s11i2w0g said:
I most definitely love the grass. It's very easy on the eyes.

lol cool, that's pretty much exactly what I want. I just want it to show you where there is grass without making you want to claw your eyeballs out haha.

So I am thinking I want levels to be both randomly generated and made with a level editor so I am thinking I will save terrain data as 1/4th resolution 4 bit greyscale images. Maps that are for the campaign mode will be a max of 10240 x 10240 in-game pixels, which works out to be about 36 sq km (That's pretty much just a rough estimate of 10m per 16 pixels. If you the fact that people are 1.8m and 16 pixels tall, then it works out to be only 1.33 sq km but the people are huge compared to the buildings. To get an idea of the scale, look at a 10ft by 10ft area of your floor and picture little 1/5th inch tall dudes running around. That's the scale for people. For buildings it will be like 7 or 14 m per 16 pixels, so picture little buildings that are a little bit bigger than the little dudes ). That size would be 12.5MB on disk which is not terrible. Using the level editor or random generator will let you make even bigger maps, of course taking up more space.

As far as the full-resolution in game terrain image, that size map would take up 300 or 400mb, I haven't decided if I need the alpha channel yet. For machines with low RAM and VRAM, that would be stored on HDD and then as chunks become visible they will be loaded to VRAM. This could lead to some performance stutters on weaker machines. For machines with good RAM but low VRAM (like a lot of Core 2 Duo laptops for example) then that would be stored in RAM and loaded to VRAM as necessary, which shouldn't be any noticable slowdown. For people who have a lot of VRAM it will all be stored there so other than loading the map the first time, nothing else really ever has to enter or leave VRAM. Which one you want to use, and likely how many chunks stored where, will be in the options.

tl;dr: Just some brainstorming on technical requirements that may or may not be interesting to you.
 
I am thinking I should be able to do 3 bits per pixel for saving it, and I will do 1/4th scale so that should be a bit over 9.3MB for a 10240 x 10240 map (for saving terrain data. The stuff like trees and then what's actually going on in the game will take more)
 
I took a couple days to explore another idea, because I haven't decided for sure that I am going to pick this idea to continue. I probably am, though. I did get some progress on the engine over the past few days, so the next step for me is to solidify the design from the coding side, so there will probably be a few more days or so where I won't necessarily have anything to share, because it will be engine side stuff that I will be working on. Then once I have the engine to a kind of a barebones renderer type of deal, I will move the prototyping onto that so I can get a better idea of what kind of performance I'll be dealing with. I am working with the general idea that if it doesn't run on my netbook, it's not fast enough, but we'll see how that works out.
 
Ok, so this isn't necessarily interesting, but I decided to post this here anywhere just to make sure I didn't stay silent too long.

This is pretty much just the same as the grass I posted before, but this would be the daytime version of it!

inqyw9.png


The shades are probably terrible, but again I am mostly interested in shape at this stage.

I also adjusted the algorithm a little bit to try to make the distribution a little more even. I will probably be adjusting it a few more times! Not really liking those solid blocks of the 2nd lightest shade.

I am still working on the engine, shouldn't be too much longer til I have it ready for me to move all my prototyping there. Then once I get a few specific prototypes I need done, I will likely refactor the engine a bit and then go into real development of the game.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top