Real-time base building?

Started by CNC_Acolythe, Sun 29/10/2017 16:19:01

Previous topic - Next topic

CNC_Acolythe

Hi!

I have just started this project, but I want to make sure in one thing:

I am creating game that will have base building element added to point & click adventure game. I have created one room which serves for base building and such, where player gets moved to every time he uses control terminal either on ship or colony centre (very much like in Imperium Galactica 1). I have few intial scripts set up, so there is beggining of colonyzation. But later in game, I want player to be able to build several different buildings. And main question is this:

How difficult would be to have this going on in background? Meaning that players chooses some building to be build, there will be animation of several stages in construction, each set up to change after for example 5 minutes. I want player to be able to exit terminal, go on about his bussiness and then perhaps recieve call about bulding being 25,50,75% ready... And all this happening regardless of him staring at base whole time or playing classic adventure part.

I did some experimentation with this, I seems to be working kind of well. But I am affraid that it would require really complicated script later in game with more buildings available, so I am thinging about having each advancement just scripted without time, to advance with general story.

Any thoughts from more experienced scripters?
Thank you!


"Holy central unit!"

dayowlron

I dont see anything in your description that would be too difficult. I would suggest just from a programmers prospective to create scripts to handle the construction and processing of the various buildings in their own module then just calling the various functions from the global script's RepExec function. This will help keep things separated if you need to add other coding to the RepExec function.
The "call" about building progress should be a GUI.
I have done some processing for a room where the player was not in that room by setting up other scripts and running them from the global script's RepExec function so that when the player returns to the room it was not in the same state it was when he left.
Pro is the opposite of Con                       Kids of today are so much different
This fact can clearly be seen,                  Don't you know?
If progress means to move forward         Just ask them where they are from
Then what does congress mean?             And they tell you where you can go.  --Nipsey Russell

Matti

I agree, this shouldn't be too difficult and I don't see why it would "require really complicated script". The amount of available buildings doesn't really matter, just use arrays/structs for the different building's production time and location (or whatever you need to keep track of).

Snarky

Yeah, this shouldn't be a problem. The only thing that worries me is that thinking it might be a problem could be a sign that you're approaching the task in a way that doesn't scale well (for example in using Timers, or hardcoding each thing individually instead of using data structures and general functions, etc.).

Quote from: dayowlron on Sun 29/10/2017 19:51:45
I dont see anything in your description that would be too difficult. I would suggest just from a programmers prospective to create scripts to handle the construction and processing of the various buildings in their own module then just calling the various functions from the global script's RepExec function. This will help keep things separated if you need to add other coding to the RepExec function.

Or even better, you can put a repeatedly_execute() function in the module itself, and that way you don't need anything in Global Script.

CNC_Acolythe

You guys are right. I was taking overly complicated approach. Looking at now, it shouldn't be as complicated as I previously thought. Thanks for help!
"Holy central unit!"

SMF spam blocked by CleanTalk