[UML] Engine
Moderator: Transport Empire Moderators
-
- Transport Empire Developer
- Posts: 699
- Joined: 03 Feb 2003 09:30
- Location: Back at the office
Yes, he has. Unfortunately, the topic in which he reports on his progress has disappeared.
Feel free to contact me over Email! My current timezone: Europe/Amsterdam (GMT+1 or GMT+2)
[ General TE Discussion ] [ TE Development ] [ TE Coding ]
Under construction...
Code: Select all
+------------Oo.------+
| Transport Empire -> |
+---------------------+
Under construction...
-
- Transport Empire Developer
- Posts: 699
- Joined: 03 Feb 2003 09:30
- Location: Back at the office
Correct me if I'm wrong, but I think that uzurpator has moderating rights in the Coding forum.
Anyway, it doesn't really matter any more. I still have a (broken) link to the original task list.
Anyway, it doesn't really matter any more. I still have a (broken) link to the original task list.
Feel free to contact me over Email! My current timezone: Europe/Amsterdam (GMT+1 or GMT+2)
[ General TE Discussion ] [ TE Development ] [ TE Coding ]
Under construction...
Code: Select all
+------------Oo.------+
| Transport Empire -> |
+---------------------+
Under construction...
- uzurpator
- Transport Empire Moderator
- Posts: 2178
- Joined: 10 Jan 2003 12:21
- Location: Katowice, Poland
Yes - I have moderating rights to the Coding forum (and the rest of TE fora as well) - and yes - I made a certain cleanup there.
Hellfire:
I understaind your architecture - and I think, that you're trying to be too specific here. Ferinstance specifying the packets for the each part of the game functionality will probably make the code difficult to manage. Also - you are trying to embed the game structure (map handling) into the engine.
What I was trying to come up with.
The game would be built on the Mediator design pattern. The mediator is the "core-network-player" axis sending packets between sender and reciever objects - whichever they may be.
Once this axis is functioning we can begin writing "engine" objects - eg those that will provide the facade for the various APIs we are going to use. Also we can provide standard engine data types such as textures (textures ferinstance can come out of a texture factory class).
The facades should be pure virtual providing just interfaces with implementations for various APIs hidden beneath it - being pretty much builder
Now - once this is "ready" (as in "workable") we can add game logic - that is maps, trains, trees etc.
If you tie the game logic into the engine - then IMHO it is a straight road to nightmare.
Anyhow - this does follow MVC but further descreets the parts of the engine.
Hellfire:
I understaind your architecture - and I think, that you're trying to be too specific here. Ferinstance specifying the packets for the each part of the game functionality will probably make the code difficult to manage. Also - you are trying to embed the game structure (map handling) into the engine.
What I was trying to come up with.
The game would be built on the Mediator design pattern. The mediator is the "core-network-player" axis sending packets between sender and reciever objects - whichever they may be.
Once this axis is functioning we can begin writing "engine" objects - eg those that will provide the facade for the various APIs we are going to use. Also we can provide standard engine data types such as textures (textures ferinstance can come out of a texture factory class).
The facades should be pure virtual providing just interfaces with implementations for various APIs hidden beneath it - being pretty much builder
Now - once this is "ready" (as in "workable") we can add game logic - that is maps, trains, trees etc.
If you tie the game logic into the engine - then IMHO it is a straight road to nightmare.
Anyhow - this does follow MVC but further descreets the parts of the engine.
All art and vehicle stats I authored for TT and derivatives are as of now PUBLIC DOMAIN! Use as you see fit
Just say NO to the TT fan-art sprite licensing madness. Public domain your art as well.
Just say NO to the TT fan-art sprite licensing madness. Public domain your art as well.
-
- Transport Empire Developer
- Posts: 699
- Joined: 03 Feb 2003 09:30
- Location: Back at the office
Could you please define the word "engine" here? If you mean the graphical core that will display _a_ game, then that's not what I've been making.uzurpator wrote:Also - you are trying to embed the game structure (map handling) into the engine.
The way I approached it, I tried to build a "model" of the game, including maps, objects, vehicles, tracks, etc. Also, I tried to include client/server communication right from the start. The way I'm handling packets might not be the best way, but at least the client/server architecture parts are there.
Feel free to contact me over Email! My current timezone: Europe/Amsterdam (GMT+1 or GMT+2)
[ General TE Discussion ] [ TE Development ] [ TE Coding ]
Under construction...
Code: Select all
+------------Oo.------+
| Transport Empire -> |
+---------------------+
Under construction...
- uzurpator
- Transport Empire Moderator
- Posts: 2178
- Joined: 10 Jan 2003 12:21
- Location: Katowice, Poland
Well - yes, but the "model" is not a monolith.
Anyhow - the model can be divided into two parts:
logic - what the game does
engine - a set of services that allows the logic to do what it needs to do
if we have , say, a locomotive. Its behavior is governed by the logic, but the display, sound playback is handled by the engine.
But that is not what I want to point here.
You are, as far as I understand, trying to embed too much of knowledge into one object. Like this:
Network sent "map request message" from something, the server knows this is a map request, so it invokes "map" object, asks for information and sends it back. The server "knows" the answer.
Consider this:
now - if a class implementing something wants anything from another class, it simply:
defines a request inheriting from data of the type the reciever can accept (forcing it to implement serialization - important for network code); constructs a packet with a pointer to its data.
demands
and the server will simply forward the packet to the recieving class, which in turn may reply in the same manner. The mediator will simply call the implementing object recieve method and pass it the packet.
This way the packeting is standardized, easy to make it thread safe (the safety is embedded in the class implementing given services, not the server itsself).
Also - if we choose to add anything to the game we do not need to change the server or any of the classes already there - frankly using this scheme we can have a working game and some other functionality in the background.
Anyhow - the model can be divided into two parts:
logic - what the game does
engine - a set of services that allows the logic to do what it needs to do
if we have , say, a locomotive. Its behavior is governed by the logic, but the display, sound playback is handled by the engine.
But that is not what I want to point here.
You are, as far as I understand, trying to embed too much of knowledge into one object. Like this:
Network sent "map request message" from something, the server knows this is a map request, so it invokes "map" object, asks for information and sends it back. The server "knows" the answer.
Consider this:
Code: Select all
typedef unsigned int uint;
class packet {
uint recieverID;
auto_ptr<data> request;
}
class data {
virtual void serialize(std::stringstream& to) = 0;
virtual void unserialize(const std::stringstream& from) = 0;
};
}
defines a request inheriting from data of the type the reciever can accept (forcing it to implement serialization - important for network code); constructs a packet with a pointer to its data.
demands
Code: Select all
::mediator.send(packet& pac);
Code: Select all
objects[packet.getReciever()].recieve(packet& pac);
Also - if we choose to add anything to the game we do not need to change the server or any of the classes already there - frankly using this scheme we can have a working game and some other functionality in the background.
All art and vehicle stats I authored for TT and derivatives are as of now PUBLIC DOMAIN! Use as you see fit
Just say NO to the TT fan-art sprite licensing madness. Public domain your art as well.
Just say NO to the TT fan-art sprite licensing madness. Public domain your art as well.
-
- Transport Empire Developer
- Posts: 699
- Joined: 03 Feb 2003 09:30
- Location: Back at the office
In that case, I've been working on the logic.uzurpator wrote:Anyhow - the model can be divided into two parts:
logic - what the game does
engine - a set of services that allows the logic to do what it needs to do
if we have , say, a locomotive. Its behavior is governed by the logic, but the display, sound playback is handled by the engine.
Perhaps I am. I never said I made the right choices. I just made the choices and if they're off, then we can always refactor later.But that is not what I want to point here.
You are, as far as I understand, trying to embed too much of knowledge into one object.
Yes, that's just a temporary "solution" to make it work. It will be delegated to another class in the future.Like this:
Network sent "map request message" from something, the server knows this is a map request, so it invokes "map" object, asks for information and sends it back. The server "knows" the answer.
The Packet class does exactly that: forcing serialization and deserialization. Also, it abstracts away from (some of) the details of RakNet and provides a simple way to send packets. (e.g. Packet::Send)Consider this:
now - if a class implementing something wants anything from another class, it simply:Code: Select all
typedef unsigned int uint; class packet { uint recieverID; auto_ptr<data> request; } class data { virtual void serialize(std::stringstream& to) = 0; virtual void unserialize(const std::stringstream& from) = 0; }; }
defines a request inheriting from data of the type the reciever can accept (forcing it to implement serialization - important for network code); constructs a packet with a pointer to its data.
I guess you're right there.demandsand the server will simply forward the packet to the recieving class, which in turn may reply in the same manner. The mediator will simply call the implementing object recieve method and pass it the packet.Code: Select all
::mediator.send(packet& pac);
This way the packeting is standardized, easy to make it thread safe (the safety is embedded in the class implementing given services, not the server itsself).Code: Select all
objects[packet.getReciever()].recieve(packet& pac);
Also - if we choose to add anything to the game we do not need to change the server or any of the classes already there - frankly using this scheme we can have a working game and some other functionality in the background.
So besides the fact that there is too much logic in some classes (which a subjective measure, by the way), is the code I wrote useful?
Feel free to contact me over Email! My current timezone: Europe/Amsterdam (GMT+1 or GMT+2)
[ General TE Discussion ] [ TE Development ] [ TE Coding ]
Under construction...
Code: Select all
+------------Oo.------+
| Transport Empire -> |
+---------------------+
Under construction...
- uzurpator
- Transport Empire Moderator
- Posts: 2178
- Joined: 10 Jan 2003 12:21
- Location: Katowice, Poland
The code is always useful - unless it is completely not related to the subject of matter
Anyhoo - In about 2 weeks I'll have more free time to use on TE, hopefully I will use my resources for TE devel
Anyhoo - In about 2 weeks I'll have more free time to use on TE, hopefully I will use my resources for TE devel
All art and vehicle stats I authored for TT and derivatives are as of now PUBLIC DOMAIN! Use as you see fit
Just say NO to the TT fan-art sprite licensing madness. Public domain your art as well.
Just say NO to the TT fan-art sprite licensing madness. Public domain your art as well.
-
- Transport Empire Developer
- Posts: 699
- Joined: 03 Feb 2003 09:30
- Location: Back at the office
I'll be on a holiday from July 31 'till August 14. That means that there will be one week that we both have a sufficient amount of free time to work together.
Locked until the DD discussion arrives at this issue.
Locked until the DD discussion arrives at this issue.
Feel free to contact me over Email! My current timezone: Europe/Amsterdam (GMT+1 or GMT+2)
[ General TE Discussion ] [ TE Development ] [ TE Coding ]
Under construction...
Code: Select all
+------------Oo.------+
| Transport Empire -> |
+---------------------+
Under construction...
Who is online
Users browsing this forum: No registered users and 15 guests