Hello! Im designing the layout of my next project atm. And im having some trouble deciding what how to do it well.
Problem nr1:
First i was thinking that the whole engine would be in one lib. But the problem here is that the server will be crossplatform, and directx wont compile on linux. Anyway even if it was just for windows, including unneccesery client functionality in the server build seems "wrong".
So i decided to make two libs, with the client lib including the serverlib. (since the client will also be able to act as server, and need alot of the functionality for lag prediction).
Is this a good way to solve the problem? Anyone who had this problem figured out a diffrent way?
Problem nr2:
Is there any good way to reuse the ai statemachines of the server on the client? I use the statemachine to controll actor animation, sound playing etc(is there a better way?). But apart from that, the code on the server and the client is identlical. But i have to paralle copies of the same code on the server ai and the client ai, except that the client also handle animation states and sound playing.
Example:
AI statemachine on server:
StateIdle
OnAttacked:
PathFind(oponent);
// Do other logic
OnDead:
Remove(this);
EndState
And the same on the client:
StateIdle
OnAttacked:
PathFind(oponent);
setAnimation(angry)
playsound(roar);
// Do other logic
OnDead:
setAnimation(dieing)
playsound(deathsound);
Remove(this);
EndState
It works but it seems like there might be a better way.. Anyhow these are the problem iv encouterd in my planning so far. Any advice is greatly appreciated. Thanks in advance
[edited by - peter_b on May 16, 2004 8:59:38 AM]
[edited by - peter_b on May 16, 2004 9:00:31 AM]