Register    Login    Forum    Search    FAQ

Board index » Everything




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: RTS Game - new project
 Post Posted: September 3rd, 2017, 2:22 pm 
 

Joined: May 19th, 2016, 6:48 am
Posts: 34
Hi Guys

I've been gone for summer holidays and right now I'm a bit busy with moving towards my new place (we bought a house yay) but I keep programming when I can. I thought it would be fun to keep you guys informed with my progress all along, so I'll try to update this post every now and then.

The goal is to make an RTS game such as StarCraft I. Of course, without the fancy graphics, as I have no drawing skills whatsoever :mrgreen: . Also, I'm not a team of 50 people ;)

Just as with the arkanoid / breakout game (http://www.planetchili.net/forum/viewtopic.php?f=3&t=3925&hilit=byteraver) I start with the tools that I need to design the game with. I want to make it as versatile an easy to use as possible, so I created an .INI file reader. I made a small ini file that describes some units and buildings to test it. Here is a portion of it:
Code:
; First we define the different types of units that can be present in the game
[Soldier]
type=unit              ; should be on top. Can be "Unit" or "building"
HasRadarCapability=No  ; whether it can detect hidden units
CanMove=yes            ; whether it can move
CanFLy=No              ; whether the unit is an airplane
CanJump=No             ; whether it can jump onto higher ground or from a cliff
MoveSpeed=10           ; how fast it can move
MaxHealth=100          ; its maximum health, can be more than 100
MaxShield=0            ; its maximum shield level
MaxEnergy=0            ; its maximum energy level
FiringRange=250        ; how close units have to be before unit can shoot them
AntiAirFirePower=10    ; how effective unit is against enemy aircraft
AntiGroundFirePower=5  ; how effective unit is against enemy ground units
FiringRate=15          ; how fast it shoots
NeededCargoSpace=1     ; how much it occupies if transported
CostToProduce=50       ; How much money it costs to produce this unit
CargoCapacity=0        ; how much cargo it can carry
Requires=Barracks      ; building(s) required to produce the unit

[Tank]
type=unit              ; should be on top. Can be "Unit" or "building"
HasRadarCapability=No  ; whether it can detect hidden units
CanMove=yes            ; whether it can move
CanFLy=No              ; whether the unit is an airplane
CanJump=No             ; whether it can jump onto higher ground or from a cliff
MoveSpeed=20           ; how fast it can move
MaxHealth=400          ; its maximum health, can be more than 100
MaxShield=400          ; its maximum shield level
MaxEnergy=0            ; its maximum energy level
(...)


I'll try to define as many things as possible (buildings, scenario's, landscapes, unit properties, etc) inside the ini file to make the game highly customizable.

Since I really loved the ease of use of the Starcraft terrain editor I decided I wanted the same kind of experience for my own terrain editor. I believe I succeeded in doing so, unfortunately I can only show a simple text-version of what a landscape would look like, as this was the fastest way to visualize the landscape on screen for debugging (the red square is a cursor :lol: ):
Image


Attachments:
TextModeLandscape.PNG [35.37 KiB]
Not downloaded yet
Top 
 Profile  
Reply with quote  
 Post Posted: September 5th, 2017, 1:31 am 
Site Admin
User avatar

Joined: December 31st, 2011, 4:53 pm
Posts: 3402
Location: Japan
Stuff looks cool man! I have a soft spot for texmode games as well. Caves of Qud is my motherfucking jam (I refuse to play Dwarf Fortress though).

Your bottom up approach of making support tools before beginning a game engine is a little strange, but it seems to work for you so I ain't gonna complain ;)

_________________
Chili


Top 
 Profile  
Reply with quote  
 Post Posted: September 7th, 2017, 9:24 am 
 

Joined: May 19th, 2016, 6:48 am
Posts: 34
I had to look up the whole rogue like game thing, it is new to me. Maybe because I never really was into the Role Playing Game genre nor the Heroic Fantasy theme. Looks cool though, would be a fantastic learning project for aspiring programmers I'd say. I really like how only the stuff that the player can see is drawn.

About the RTS Project: I figured that if I wanted to make several terrains easily I would need a terrain editor, so I started with that. Cutting the project up in manageable chunks is important for me, I don't loose courage this way ;) I do have a road map in my head, something like this:

- .ini file Reader: "done"
- Terrain editor: still need save & load routines, possibility to add objects (ramps, trees, ...). I'm still wondering if I should save the terrain in a text file (.ini) or in a binary file. I'm actually thinking of using .ini files only for everything to make the program as accessible as possible
- Create terrain graphics in a procedural manner so the game can still be played if bitmap data is missing (sprites)
- Make a graphic version of the terrain editor (mouse driven)
- Work out the logic of a scenario (starting points, dialogue triggers, winning / loosing triggers, what units / buildings are available to the player and / or the enemy, ...)
- Enhance the terrain editor to create a campaign editor
- Create fog of war logic (hidden terrain, previously scouted terrain, monitored terrain)
- Implement path finding algoritm
- Create basic game mechanics (loading units, buildings, conditionals, scenario's from .ini files)
- Create a castle defender game type (build a base, defend against attack waves)
- Create an RTS game type (create "intelligent" enemy)

See? Almost done :lol:


Top 
 Profile  
Reply with quote  
 Post Posted: September 8th, 2017, 1:20 am 
Site Admin
User avatar

Joined: December 31st, 2011, 4:53 pm
Posts: 3402
Location: Japan
Have you considered using an xml format (or even json?) There are parser libs for those that would make your life a lot easier, and xml is the industry standard for these kinds of files.

If you're interested check out pugixml

_________________
Chili


Top 
 Profile  
Reply with quote  
 Post Posted: September 8th, 2017, 9:18 am 
 

Joined: May 19th, 2016, 6:48 am
Posts: 34
Hi Chili, thanks for the suggestion. I did consider JSON but thought it would be easier to parse .ini files than JSON files (maybe I'm wrong ;)). We use XML at work, I have to deal with it regularly to check what went wrong with customers buying products, creating email addresses, hosting accounts and so on and I find that it is a super ugly, reader unfriendly syntax. The useful information is hidden between all those tags. It should be rather easy to parse though.
JSON is much easier to read but arguably harder to parse (I didn't try). As I don't like to use other people's code I choose the .ini file "layout" because I like how clean it looks. Maybe it's just down to personal preference.


Top 
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 5 posts ] 

Board index » Everything


 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron