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.

Newcomers DBPro Corner / zombie rts

Author
Message
Moe
18
Years of Service
User Offline
Joined: 1st Apr 2006
Location: Sunny California
Posted: 21st Oct 2007 06:03
I am a newbie at Darkbasic, and i want to create a zombie RTS. i am encountering a few problems. First of all would be the selection. once i know how to select an object by clicking it, i will probably be able to select an object using a selection box, but i dont know how to do this. i also might need some help on the ai, but i'll update this thread once i get more indepth

parrot
Veron
17
Years of Service
User Offline
Joined: 22nd Nov 2006
Location:
Posted: 21st Oct 2007 06:29
I reccomend starting with an easier project than an RTS, for example, a small platformer. Also, read the tutorials located here - http://forum.thegamecreators.com/?m=forum_view&t=99497&b=10 - they're an invaluable source of information.


Uncle Sam
19
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 21st Oct 2007 06:45
Actually, starting with a hard project is a good way to get a realistic picture of what it takes to make a game.

To select an object, you can use the pick object command.



The above piece of code will return and store in the variable, "objnum", the object number that the mouse is currently position over, and it will only detect the objects between and equal to 1 and 1000. If you want it to pick the object ONLY when you click:





calcyman
17
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 21st Oct 2007 13:27
DIM objects_selected(totalobjects)

Here is the box selection algorithm (in semi-pseudocode)



Your signature has been erased by a hyper-intelligent pan-dimensional being (a mod)
Emphasoft
17
Years of Service
User Offline
Joined: 2nd Jun 2007
Location: Deep Underneath the Center of the Earth
Posted: 21st Oct 2007 17:26
and here is my box selection algorithm without pseudocode:
reference me in the credits if you use it.

this only works when dragging from top left to bottom right

Why fight when you can negotiate?
-Jack Sparrow
Moe
18
Years of Service
User Offline
Joined: 1st Apr 2006
Location: Sunny California
Posted: 22nd Oct 2007 04:15 Edited at: 22nd Oct 2007 04:27
so... what your saying is that i need to have a variable that means selected or deselected for each object? i'll try to use gosubs and for/next statements but i have a feeling im going to run into some trouble. Also, uncle sam, why are the values in


1 and 1000? i dont really get what object start and object end means.

parrot
Moe
18
Years of Service
User Offline
Joined: 1st Apr 2006
Location: Sunny California
Posted: 22nd Oct 2007 04:19
srry double post

parrot
TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 22nd Oct 2007 13:02
Moe, Im curious as to how your Zombie RTS will play. You wouldn't mind sharing that info would you?

Moe
18
Years of Service
User Offline
Joined: 1st Apr 2006
Location: Sunny California
Posted: 24th Oct 2007 05:13
Thank you windows killer.
Tech lord:
I like zombie movies and games, but a zombie rts has yet to be made.
I want it to play with individual units, instead of groups of units (like empire earth). Individual units will be able to set up certain defenses, but more will be required to set up others, almost exactly like moving objects in pikmin. There will be several game types (im planning) Clear the city, where you sweep units through and secure areas. Hold the line, where you defend an area and zombie start coming after a set amount of time. And rescue, kind of a combonation of both. Of these types i want to have two settings. Superstrong zombies that move slow, like the origional. Or the 28 days later type, where the virus infects 10 seconds afterwards. (in the regular type i want to have the virus be able to spread through food, and proximity to the origional infected.)...

but i'm getting really carried away here. it would be an incredibly complex game,m and im a newbie. But thats my ultimate goal, i just want to start with a prototype where you control a couple of squares that cant shoot, and you move them around away from the zombies (green squares). from there i want to proceed to ai, instead of a aimless zombie. Once i get okay ai (whether its through dll or state ai)i want to progress to buildings, and pathfinding ai. Once i get that dont i want to progress to units, adding more ai and ability to shoot. Once i get that down i;ll proceed to buildings etc. etc.

For now a simple matrix with green cubes is what i'm aiming for.

parrot
Moe
18
Years of Service
User Offline
Joined: 1st Apr 2006
Location: Sunny California
Posted: 24th Oct 2007 05:40
Alright, i have the initialization ready... lol not much. I'll keep it completely open source incase anyone has any suggestions... wait i have to do the camera


parrot
Moe
18
Years of Service
User Offline
Joined: 1st Apr 2006
Location: Sunny California
Posted: 24th Oct 2007 05:53
hmm... the camera movement isnt working and the matrix isnt showing up (heres the updated and tested code, ignore the stuff above


parrot
TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 24th Oct 2007 12:52 Edited at: 24th Oct 2007 19:19
Moe, I highly recommend you adopt a Naming Convention and Coding Ruleset early on before your code grows out of control. For ideas you can check out my DarkMORG Thread, section on DarkCore.

You may also want to develope a Object Management System to track objects created and deleted. My rules of thumb are:

1)If objects are created/deleted, recycled, reused often during run time use a stack to push/pop (recycling) IDs.

2) If objects are only assigned once or must be uniquely identified use a Counter to increment assigned IDs. In some cases the ID is assigned during loading, or over the net.

To to sum Object Management up, every Object should have an ID for referencing to manage it properly.

Login to post a reply

Server time is: 2024-09-27 08:18:13
Your offset time is: 2024-09-27 08:18:13