[Porting] RTS Demo

PatrickB3

23-09-2006 18:50:03

Tuan I started a new thread as this is going to need its own.

You said to use the Ogre SDK, however this isn't going to really work as is.

PLSM2 needs the headers:
#include "OgrePagingLandScapeOctree.h"
#include "OgrePagingLandScapeOcclusion.h"
#include "OgrePagingLandScapePoolSet.h"

which are not in the SDK version of Ogre.

kungfoomasta

23-09-2006 19:07:48

PatrickB3, I have a really dumb question... what does RTS stand for? Real Time Strategy? :lol:

I'm curious to learn more about what functionality this demo will have.

KungFooMasta

PatrickB3

23-09-2006 19:11:20

OK, RTS is just being really bad. Ignore the previous post as fixing it to be good and just use SceneManager * instead of a pointer to the exact SceneManager releases the need for these headers.

kungfoomasta

23-09-2006 19:17:14

Quick response! Nothing related to my post, but fast nonetheless :P

KungFooMasta

PatrickB3

23-09-2006 20:55:50

Yeah Real Time Strategy. It was a demo made a really long time ago for PLSM showing how to use it in a game environment.

PatrickB3

24-09-2006 00:39:49

Well I got it to compile and run which is a start.



It mostly works actually.

Left to fix:
Movement Keys don't work. Though Mouse Move does.
Uses Alpes in Splatting2. Need to change to SmallWorld and a prettier material type. I don't have the original map of SmallWorld to run through MapSplitter though. I used the SmallWorld scaling however so it don't look like the alpes. Imagine the alpes have been bulldozed. I assume being from France that could be upsetting to you. ;)
Fixing the Selected Object Notifications.
A little cleaning up.
Upgrading RTS's Billboard Chains to use the Ogre ones.
Figuring out how in the world anyone could ever compile this.

The last problem is figuring out a code layout. It needs SDL which isn't pretty. Needs PLSM2 Headers which are usually in the CVS Ogre not the SDK one. PLSM2 does not build with Ogre SDK only CVS or Full Code Install. Dlls need to built with the proper compiler ( VC7 or VC8 ) they do not interchange.

PatrickB3

24-09-2006 01:04:15

Fixed Movement. I was really really wrong on how to compute the World Size.

It used to call GetWorldSize but can't any more since I am sticking to getOption.

This is what I'm doing:

// Compute World Size
Ogre::uint wsX, wsZ, pageSize;
global->sceneMgr->getOption( "Width", &wsX );
global->sceneMgr->getOption( "Height", &wsZ );
global->sceneMgr->getOption( "PageSize", &pageSize );
Ogre::Real ScaleX, ScaleZ;
global->sceneMgr->getOption( "ScaleX", &ScaleX );
global->sceneMgr->getOption( "ScaleZ", &ScaleZ );
global->worldSizeX = (Ogre::Real ) ( wsX * ( pageSize -1 ) ) * ScaleX;
global->worldSizeZ = (Ogre::Real ) ( wsZ * ( pageSize -1 ) ) * ScaleZ;
assert((global->worldSizeX != 0) && (global->worldSizeZ != 0));
global->worldHalfSizeX = global->worldSizeX / 2.0f;
global->worldHalfSizeZ = global->worldSizeZ / 2.0f;


It's kinda lot of work. Might be better to add a GetOption that gives the World Size in a Vector3. Or there may be one and I just couldn't find it.

tuan kuranes

25-09-2006 15:10:25

Excellent, Great work !
Needs PLSM2 Headers which are usually in the CVS Ogre not the SDK one
Why would it needs header ? it uses listener ?
Anyway, do not work too hard on that I'll integrate that into current build system and prerequisites, where plsm2 are in $(OGRE_HOME)/../paginglandscape/plugins/paginglandscape2/include/

It needs SDL which isn't pretty. As already said, best is not to use SDL nor OIS. if you done OIS, that's fine, but for better dependency, I'll go for old dagon input, so that user doesn't need complex dependency. I can do the ogre input old way add using defines.
it used to call GetWorldSize but can't any more since I am sticking to getOption.
- Isn't that equivalent of getOption("MapBoundaries", &(AxisAlignedBoundingBox *) myBoundaries)). That said I can add a getOption("getWorldSize", &(Vector3 *)myVector3)

ps : I'm even living inside the alpes ;)

OvermindDL1

25-09-2006 18:19:27

Is not the next Ogre using OIS for input, and PLSM3 will most likely not be done by the first preview?

tuan kuranes

25-09-2006 20:15:23

ogre is for end of the year, I hope RTS demo and plsm3 will ship before that, and therefore not requiring OIS may help forum work

PatrickB3

25-09-2006 20:56:45


Needs PLSM2 Headers which are usually in the CVS Ogre not the SDK one


I have killed off this requirement. It was the same problem my game had actually. Needing the query masks.


- Isn't that equivalent of getOption("MapBoundaries", &(AxisAlignedBoundingBox *) myBoundaries)). That said I can add a getOption("getWorldSize", &(Vector3 *)myVector3)


Yep it is and it did the trick.

PatrickB3

25-09-2006 21:01:17

@OvermindDL1

The difference really is that when OIS is part of Ogre it won't require anything special to compile. If I add OIS now it will require people who want to compile the demo to download and compile OIS seperately.

Both Tuan and I want this to be as easy to compile as possiable. It took me forever to get the existing demo ( the one with PLSM2 not the rts demo ) to both compile and run. It was hard enough that I avoided PLSM2 for as long as I could. There is nothing scary really about PLSM2 so I hope to not scare people with the demo. Ironically it was easier to port this than to compile the orginal demo as I know so much more about PLSM2, CEGUI, and Ogre now. ;)

OvermindDL1

25-09-2006 21:40:28

Yea, understood.

tuan kuranes

29-11-2006 16:07:24

any news or some code I could start integrating ?