Game Development Community

Buildings doing something

by DejaBlue · in RTS Starter Kit · 11/16/2004 (10:23 am) · 13 replies

How would you go about making a building do a certain job.

for example

Food: you place a field this field would generate X number of food per 5 seconds
would this be nothing more then a timer running? if so and yes i am totally programming unguru how would i implement this? as i do graphics and trying to figure out the aspects of this, if i could get some info it would lead to other aspects of the game i am making being able to work together.

thanks for any help

#1
11/16/2004 (10:48 am)
@Dianne: Welcome!

So you know, there are several projects just now catching up on all the kit has to offer. I personally, while finishing debugging our pack import to our game, am working on figuring out the mechanisms and "good techniques" to do exactly what you are saying.

What I'm getting at is that if you are a couple of days to a week more patient, I'm sure someone will have put together a package like the other resources that have already shown up to explain a good technique in detail.

If this debugging goes well, it may even be me, but there are a -lot- of others here much more experienced than I.
#2
11/16/2004 (11:22 am)
Thank you for such a quick response. i do look forward to anything dealing with the rts pack as i am a avid rts gamer and have alot of ideas already so for mean time will work on the UI and other stuff related to my prep time til more info is available.
#3
11/16/2004 (11:56 am)
This is how I would do it. On the server, keep track of how many buildings a player has that produce this food, and run a schedule() call for every 5 seconds, and then increase their food by X * number_of_buildings
#4
11/21/2004 (9:01 pm)
I made good progress on this tonight, and will probably release some form of resource for it mid- to late week. FYI, the resource Manager resource I posted does have the demo building generate gold for you every 5 seconds, and with this next resource, you'll be able to train troops from the building as well!
#5
11/22/2004 (5:02 am)
I have been watching everypost bugs,resources,general sections everyday, Stephen wold like to thank you for all your input you have done and that you will do in the future. your advice and such in all the forums is invaluable.
#6
11/22/2004 (5:07 am)
@DejaBlue: Glad to hear it's helping!I just love this kind of thing, hehe...and since I'm writing basic functionality scripts as prototypes for my own project, no reason at all not to make them clean and then release them!
#7
11/22/2004 (3:35 pm)
Well, I've got the functionality and state management working well for having buildings train troops, but there are three (non-implementation specific) issues rearing their heads:

1) This isn't nearly as "clean" as the resource store manager was. For one, the implementation isn't particularly extensible, and also some of the code that it is based off of (selection of units mostly) I don't quite grok fully yet, so I -know- there are both issues with how I did things, as well as almost certainly bugs.

2) Both my project, and everyone else's out there, are diverging from the "stock" RTS SK drastically and rapidly--making fully robot-like install instructions for this resource much more difficult. The readme for this isn't going to be nearly as detailed as the basic resource manager was.

3) My project won't be going any further in this particular implementation direction--our vision and design docs are quite different from the basic implementation I put together. In other words, come a month from now (or even a few weeks), my knowledge of the "train units" implementation will be fuzzy at best, and I won't have a working version to compare any issues anyone else comes up with against.

All that being said, it works well for what it's designed for, and if you are willing to take the time to play around with it and get it working--and more importantly, know that this is most assuredly not going to be a "drop in and play" type of resource, I can make it available.

SO....all that being said..do folks still want it?
#8
11/23/2004 (5:40 am)
I say yes if it will help even one then its well woth it
#9
11/23/2004 (5:42 am)
Go for it Stephen.
#10
11/23/2004 (6:05 am)
Based on the positive response, I decided last night to refactor the resource to make it at least a bit more easily expandable.

Of course, now it's broken! Working on it however :)
#11
11/23/2004 (6:18 am)
Ill be working on buildings all day /sigh finally got max to work and get the file into torque ( dumy items, and naming of the items i had to get down right) all i need todo is now figure the sequence of animations.


stupid question on the buildings animation for anyone, the building we have is animated with idle,die and another off my head cant remember. lets say the building gets a "upgrade btton" where the building might add something. do you just code it that the building gets replaced with another "building" not sure how upgrades of buildings would work if the building itself gets a upgrade

for example:
we move from one age to another age: in the next age buildings will change to the time period. so how would you say take the capitol of your area and have it show the new model
#12
11/23/2004 (6:27 am)
@DejaBlue: good question. In our project, the answer is "yes--we will replace a building when it is upgraded to a completely different datablock (which contains a different .dts shape).

For the community demo, assuming I get to that stage, I would be probably just scaling the building up a little bit or something, but in general, our plan is to completely change the building itself to a new building.
#13
11/23/2004 (6:30 am)
Hehehehe /looks into stephen's notes

hmmm stephen you sure you not looking over my shoulder, seems alot of same ideas but then again it is a rts