Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

guyver6

Handling Starship Mechanics

This topic is 5715 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

[SPOILER -- IT''S LONG ] First of all it''s my first post to this forum (though I was a passive reader for a long time) and at last, I''ve got great chance to say HELLO to every one here. Recently, I''ve been thinking of a spaceship battle simulation, you know, gigant starships, handsome captains surrounded by a beautiful female crew, fighting in a historic battles, blah, blah, blah. But my point is that this starships would be not just a simple models, flying around and firing kind of lasers or missles. Take for example ships from Star Trek. These monsters had a somehow realistic engineering design, with source of power (or energy, whatever), connections that delivered that power to subsystems of the ship, on-board main computer had an ability to transfer some power from one subsystem to another etc. And here is where I''ve stopped. I was thinking of how to program such ship system, with reactor (or more sources of energy), with power-drainers which means system, ie. propulsion (which can consist of few engine types, impulse, manoeuvring, warp drive, like in star trek), shields (which would be actually a set of shield field generators placed on hull), communication, sensors, weapons, etc. Then a main-frame computer to controll all of it, and also requiring some power to operate. And then connections to transfer that power from source to subsystems. "But hey! What for connections between systems?" you may ask. Becouse of realism. Imagine that you fire phasers in the enemy ship. The enemy shields are down, your weapon hits the target. What it hit? A polygon? A 3D model? And what? It''s Hit Points are taken? No, I want that phaser to do some REAL damage, ie. hits the particular connection, which was used to power right phasers array of the enemy ship. The damaged connection cannot deliver as much power to phasers, as needed. The enemy has to rotate ship to protect it''s weak point. From the programming point of view it''s also not so easy. Despite the problem of controlling that monster, which I''m planning to build moslty on events and state machines (becouse I can''t imagine that one person could control so many subsystems alone, let the AI take care of it), I cannot come with reliable system of connections and the idea of source and drainer. I tried to made a class Element, which is the base for Source, Drainer and Connection, then come with idea of making separate base class for connections (and note, that connection includes streight connection, just with two ends placed in space relative to model of the ship, but also this could be a differential type of connection, which gets power from one point and distributes it to two ends, depending of some setting, controlled ie. by AI or manually). The problem is in transfering the power. How to design a system in which elements requires some power to operate, elements transfer power in two directions, hit or damaged elements can send a power-peek, that could lead to overload of some other elements. Could someone discuss some of the possible approches, realtime of course, that take delta time when updating state? Becouse this post covers either game design, programming and physics, I ask moderator to move it to proper forum if he decides that it''s off topic. And sorry for problem, but it''s my first post and I have a real dilemma where to put it. Thanks for feedback and Happy Easter, Guyver

Share this post


Link to post
Share on other sites
Advertisement
Yes i came up with the same idea and started developing it.. except you can build ships too using a realistic joint mechanism to add wings, flight decks, communications systems etc.

Take a look at the web site (there are some screenshots) and download the demo:
http://www.startorn.com

You can see from the screenshots how engines (with their own fuel and energy models) can be added to any valid joint on the ship. Each ship has its own reactor type which distributes energy to the components.

Share this post


Link to post
Share on other sites
You could create a tree structure of your "element" class that uses pointers to determine what systems a component powers. For instance, the reactor would be at the head of the tree, with pointers to the shields and weapons. While the reactor isn't damaged, it sends 100% of its power to these systems. When it gets damaged, it only sends say 75% of the power to these systems, thereby simulating a reduction in efficiency. You could make this as simple or as complex as you want, for instance adding several different connections between components, and then using a pathfinding algorithm to traverse the tree when particular components are damaged.

[edited by - the_dannobot on April 22, 2003 2:55:11 PM]

Share this post


Link to post
Share on other sites
For each instance of class element you need an array of "Dependent on" and "Dependencies"

so basically the engine would be dependent on the hull around it
the computer and weapons would be dependent on the engine. As far as power levels you may have to include a function in the engine for "getting the available power" which would return how mcuh power it can get based off of the percentages the user has set. Once the power levels are sent to the individual systems, the systems would determine what can be done based off of the power available. You could also have "send power" for sending power spikes etc. Think of the real life connections as functions and i think the pieces will fall together. Please e-mail me if this was helpful and you want any more help.

jackbunny@mchsi.com

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!