Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Turn based stradegy games?

Author
Message
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 15th Jun 2004 02:07
HI

I have a project that I really want to make but I probably wont ever get it complete without help from the community here so here it goes.

My plan was for a TBS, each player has one turn, and within that turn they can performe a maximum of 3 actions whether it be to move, attack, launch a WMD etc.. But how would I go about doing that? I should also mention that each turn is a maximum of 1 minute, so after that the turn is handed over to the next player. Any pointers or suggestions on how to make that kind of turn system?

While I am already talking about this game, I might as well get another question out of the way...
At the beginning of the game each player is givin the opportunity to place all the units under their command anyware withing their territory. This includes tanks, infantry, bunkers, or battleships. After the players reservoir of units has been used up, it is the next players turn to place his units. How can I make it so that it will allow them to place a set number of different kinds of units on a map? and them be able to click them and control them later?

Thanks in advance.

P4 3.2Ghz/Alienware area 51/radeon 9800 pro 256mb/sound blaster audigy 2/5.1 surround sound speakers.
zircher
22
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 15th Jun 2004 03:23
That's not really that hard to do. You just zero a counter for each player when it is their turn and increase the counter as they perform actions. When it gets to three, zero the counter and move on to the next player. Repeat until victory is achieved.

The timer works the same way. When it becomes the player's turn set a variable to the timer + 60,000 milliseconds. When the current timer exceeds the second variable, you know that time is up. Go to the next player and reset the variable for them.
--
TAZ

History did not begin with PONG. -- Greg Costikyan

Game Beavers
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 16th Jun 2004 04:34
Thanks I never thought of that, I knew it would have alot to do with "if and then" commands but I didnt think of that.

I have another question. I wanted to give the player more control over their units than the ordinary "click were you want them to go" so I decided that a player would click on the unit they want then use the arrow keys to move around, but I downt want the player to be able to just drive all the way to the enemy base in one turn, so I devised a "miles" system, different units can travel different amounts per turn, for example a tank can travel 10 miles per-turn so as you drive around I want a counter to slowely count away until zero at witch point they will have used up their turn. The problem is, how do I figure out how many "miles" the tank has driven? of course it wont be to scale.


Thanks

P4 3.2Ghz/Alienware area 51/radeon 9800 pro 256mb/sound blaster audigy 2/5.1 surround sound speakers.
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 16th Jun 2004 06:11
When you move units typically you'll want to use the NEW X POSITION and NEW Z POSITION commands. You feed these parameters into them:

Current X/Z,Angle Value,Raiud/Step Value

Current X/Z=Current X or Z position of the object.
Angle Value=Direction object is facing, or the Y angle since the object is moving as though along the ground
Raiud/Step Value=How many units you want the object to move.

Perform these calculations for x and z, and keep track of the step value.



Crazy Donut Productions, Current Project: KillZone
Web Site Button Does Not Work, Visit Here: http://www.geocities.com/crazydonutproductions/index.html
Major Payn
21
Years of Service
User Offline
Joined: 16th Dec 2003
Location: United States of America
Posted: 16th Jun 2004 22:10
Thaks, but can this same thing be used on many units? Because you will be controlling about 100 units in the game.

P4 3.2Ghz/Alienware area 51/radeon 9800 pro 256mb/sound blaster audigy 2/5.1 surround sound speakers.
zircher
22
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 17th Jun 2004 00:07 Edited at: 17th Jun 2004 00:08
I'd suggest using an array based on a UDT (user defined type.) That way each 'record' in the array can hold whatever unit details you need.
--
TAZ

[If DB does not have UDTs, you can get the same effect by have several arrays set up in parallel or use a multi-dimensional array.]

History did not begin with PONG. -- Greg Costikyan

Game Beavers
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 17th Jun 2004 05:19
Or if you can get it to work withou bugs, DarkEdit has extended syntax for UDTs.

Arrays are probably your best course, though. Just keep a record of what each slot is for.

ie:
Maps(x,8)
***special***Maps(0,0) will determine mp(2) or 1p(1)
1. filename
2. object number
3. xpos
4. ypos
5. zpos
6. xrot
7. yrot
8. zrot

Crazy Donut Productions, Current Project: KillZone
Web Site Button Does Not Work, Visit Here: http://www.geocities.com/crazydonutproductions/index.html

Login to post a reply

Server time is: 2025-05-26 05:22:20
Your offset time is: 2025-05-26 05:22:20