May 15, 2005, 10:44 PM | |
Mechaius Technical Design
I don't remember what or how much was planned before, but as something to get restarted on the technical design, I was sketching out some of the architecture through some of the classes/components I think will be needed. This is not complete, but it is something to start with.
(Bleh, sorry for the poor formatting. I could just do things in Word documents or something so it looks nicer.) Code:
Program Purpose Holds everything for the program Single instance Contains Game Menus Form Render Device Game Purpose For everything in the actual game (as in part of the gameplay), and nothing else. Single instance Contains Level Player collection Level Purpose For everything in a single level. Single instance Contains Map Object collection Player Purpose Everything related to the player in the game Multiple instances Contains Controlled object Map Purpose Contains the arrangement of tiles that make up the level. Single instance Contains Tileset Tileset Purpose Contains a full tileset. Single instance Contains Managed tile collection Object Purpose Abstract base class for all dynamic objects in the game. Multiple instances Renderable Object Purpose An object that can be rendered Contains Reference to a Graphic Resource through the Resource Manager Resource Manager Purpose Stores, loads, and otherwise manages all resources. Resource Purpose Abstract base class for all resources (such as graphics, sounds, etc.). Multiple instances Graphic Resource Derives from Resource Purpose Contains a graphical resource Menus Purpose For a system of menus. Contains Menu collection Menu Purpose The stuff for a single menu screen. Form Purpose Just the standard empty form there to be used for drawing. Doesn't really contain anything. Render Device Purpose Interfaces with the graphics library for all the rendering. Contains All stuff needed for the graphics library Reference to the form to draw to
__________________
<div style="float: right; width: 100px; height: 70px; margin: 5px 15px;"><img src="http://madskills.org/monolith/idleserver.gif" style="width: 98px; height: 65px;"><img src="http://madskills.org/monolith/theserver.gif" style="width: 98px; height: 65px; position: relative; top: -65px;"></div><div style="margin: 0 3em; font-size: 80%; font-style: italic;">Love is patient, love is kind. It does not envy, it does not boast, it is not proud. It is not rude, it is not self-seeking, it is not easily angered, it keeps no record of wrongs. Love does not delight in evil but rejoices with the truth. It always protects, always trusts, always hopes, always perseveres.</div><div style="text-align: right; text-size: 80%;">1 Corinthians 13:4-7</div> |
May 16, 2005, 08:04 PM | |||||||||||||||||||||||||||||||||||||||||||||||||||
This is a great start! I made few adjustments and (hopefully) clarifications. I'm assuming we use some kind of Singleton class, but I haven't yet figured out a clean way to do this with C#.
class Application : Singleton
class Game : Singleton
class Level : Singleton
class Player : IControllableObject
class Layer
class Tile
class Tileset
interface IGameObject
interface IRenderableObject
class ResourceManager : Singleton
interface IResource
class GraphicResource : IResource
class Menus
class Menu
class GameForm : Windows.Form
class RenderDevice
|
May 17, 2005, 07:11 PM | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Forcing those classes to be singletons isn't really necessary. You just normally keep one instance of those classes around anyway. I actually think it's simpler to not bother with making them singletons. Plus there might be some instances where you want more than one instance of one of those classes. Like for dynaimcally loading one level while the player is in another.
class Application
class RenderDevice
class SoundDevice
class ResourceManager
interface IResource
class GraphicResource : IResource
class SoundResource : IResource
class MusicResource : IResource
class Game
class Level
class Layer
class Tileset
struct Tile
interface IGameObject
interface IUpdatableObject
interface IRenderableObject
class Player : IControllableObject
interface IControllableObject
class Menus
class Menu
class MenuObject
There will be multiple tilesets used within a level? Is IGameObject the same as I'm thinking for IUpdatableObject? IUpdatableObject can be used outside of the game though, such as for the menus. I think we won't need a GameFrom class. A normal Windows.Form should be fine. I know we need something for input, but that's not something I'm too familiar with. Also I'm thinking the Game and Level objects should be both Updatables and Renderables.
__________________
<div style="float: right; width: 100px; height: 70px; margin: 5px 15px;"><img src="http://madskills.org/monolith/idleserver.gif" style="width: 98px; height: 65px;"><img src="http://madskills.org/monolith/theserver.gif" style="width: 98px; height: 65px; position: relative; top: -65px;"></div><div style="margin: 0 3em; font-size: 80%; font-style: italic;">Love is patient, love is kind. It does not envy, it does not boast, it is not proud. It is not rude, it is not self-seeking, it is not easily angered, it keeps no record of wrongs. Love does not delight in evil but rejoices with the truth. It always protects, always trusts, always hopes, always perseveres.</div><div style="text-align: right; text-size: 80%;">1 Corinthians 13:4-7</div> |
May 17, 2005, 07:36 PM | |
The dream was to allow multiple tilesets to be used on a given level. Using this method, we could make the tilesets more specialized (hence, smaller).
I think both the IGameObject and IUpdatableObject interfaces would probably serve the same purpose, as most (all?) objects in a game have state that can be updated. Let's start fleshing out these interfaces: IResource - .Release() IUpdatable - .SetState(IObjectState) IObjectState (?) - .Name IRenderable - .Render() IControllable - .SendCommand(IControlCommand) IControlCommand() - ? IMovable - .Transform(Matrix) Changes? Additions? Am I overdoing it on the interfaces yet? I can add more! I'm not sure what overhead is involved (if any) when using interfaces in .NET. We'll have to do some careful profiling to make sure we don't incorporate something that will bring the game down to a crawl. -Nag Last edited by Onag; May 17, 2005 at 07:46 PM. |
May 18, 2005, 06:45 PM | |
Interfaces are good so long as they're abstract. Once you start getting to where you can specify data or functions, then you should start using real classes. Like for the IMovable. That is at least something with a location, so right there it has some specific data and functions for that data. (Actually you might as well let the location data be public if it's simple enough.) IControlCommand might not be an interface either.
I'm not sure what you're thinking of with the IObjectState for the IUpdatable. My purpose of the IUpdatable is that it has an update function. This way you can have a collection of IUpdatables to loop through in the update task, just like you'd have a collection of IRenderable to call Render on in the render task. States for objects probably wouldn't be needed till you get to something more specific. And for resources, I have to think a bit about how resource management would work.
__________________
<div style="float: right; width: 100px; height: 70px; margin: 5px 15px;"><img src="http://madskills.org/monolith/idleserver.gif" style="width: 98px; height: 65px;"><img src="http://madskills.org/monolith/theserver.gif" style="width: 98px; height: 65px; position: relative; top: -65px;"></div><div style="margin: 0 3em; font-size: 80%; font-style: italic;">Love is patient, love is kind. It does not envy, it does not boast, it is not proud. It is not rude, it is not self-seeking, it is not easily angered, it keeps no record of wrongs. Love does not delight in evil but rejoices with the truth. It always protects, always trusts, always hopes, always perseveres.</div><div style="text-align: right; text-size: 80%;">1 Corinthians 13:4-7</div> |
May 18, 2005, 10:31 PM | |
Here's an example (though not a very good one) of where IMovable would be useful:
A mine explodes, sending a shockwave throughout the surrounding area. In this area, you have the player, some baddies, some ammo lying around, and a large, half-burried rock. You would want everything but the rock to move. One easy way to handle this is to check all objects in the shock-wave to see if they implement IMovable, then move them accordingly. We could put the location data and move method in a class, but .NET limits us to single inheritance outside of interfaces, so we have to be careful about what we put in base classes. IObjectState can go. I was misinterpreting the meaning of IUdatable. Also, IRenderable is a must, but I don't think it should have any implied reference to a graphic resource. This would limit its capabilities. -Nag Last edited by Onag; May 23, 2005 at 10:29 PM. |
May 19, 2005, 07:41 PM | |
I think before we can flesh out all the object classes and interfaces, we need to know what all the objects are going to be. So basically objects need to be completed in the game design before we can work on it in the technical design.
There's still pleanty of stuff on the technical side that can be designed in the meantime though, such as how input, rendering, updates, resource management, etc. can be delt with.
__________________
<div style="float: right; width: 100px; height: 70px; margin: 5px 15px;"><img src="http://madskills.org/monolith/idleserver.gif" style="width: 98px; height: 65px;"><img src="http://madskills.org/monolith/theserver.gif" style="width: 98px; height: 65px; position: relative; top: -65px;"></div><div style="margin: 0 3em; font-size: 80%; font-style: italic;">Love is patient, love is kind. It does not envy, it does not boast, it is not proud. It is not rude, it is not self-seeking, it is not easily angered, it keeps no record of wrongs. Love does not delight in evil but rejoices with the truth. It always protects, always trusts, always hopes, always perseveres.</div><div style="text-align: right; text-size: 80%;">1 Corinthians 13:4-7</div> |
![]() |
«
Previous Thread
|
Next Thread
»
Thread Tools | |
|
|
All times are GMT -8. The time now is 03:42 AM.
Jazz2Online © 1999-INFINITY (Site Credits). Jazz Jackrabbit, Jazz Jackrabbit 2, Jazz Jackrabbit Advance and all related trademarks and media are ™ and © Epic Games. Lori Jackrabbit is © Dean Dodrill. J2O development powered by Loops of Fury and Chemical Beats. Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Original site design by Ovi Demetrian. DrJones is the puppet master. Eat your lima beans, Johnny.