RTS style sample app

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
User avatar
DrPain
Gnome
Posts: 349
Joined: Tue Jul 05, 2005 2:51 pm
Location: Connecticut, USA

RTS style sample app

Post by DrPain »

Well, my TestApp is starting go grow some meat on its bones.

Major features include:
  • Input via SDL.
    Key remapping capabilities, and saving/retrieving from a text file.
    Game State architecture, with loading and exit screens.
    Object selection: area dragging and single object (hold CTRL key to add to selection).
    Mini-map.
    Compass/location indicator.
Here in this first image you can see object selection in action, as well as the compass and mini-map.

Image

And here you can see the key remapping dialog.
The dialog checks for repeated keys and "unmappable" keys.
The red Z in the screenshot indicates a newly changed key.
The blue keys cannot be changed.
Image

Commands are mapped via a structure as follows:

Code: Select all

   commandMap[commandIndex].keyCmd1 = SDLK_WHEEL_DN;
   commandMap[commandIndex].keyCmd2 = SDLK_e;
   commandMap[commandIndex].isCustomizable1 = FALSE;
   commandMap[commandIndex].isCustomizable2 = TRUE;
   commandMap[commandIndex].commandName = "CameraUp";
   commandMap[commandIndex].commandDescr = "Camera Up";
   commandMap[commandIndex].streamingCmd1 = FALSE;
   commandMap[commandIndex].streamingCmd2 = TRUE;
   commandMap[commandIndex].handlerFunc = Command_CameraUp;
   commandIndex++;
As you can see, it's fairly easy to add new keybindings.

Still left to do:
  • Allow removal from object selections (using Shift key).
    Add local objects to mini-map.
    Clean up the Console dialog and add context-sensitive information/command buttons.
stodge
Goblin
Posts: 217
Joined: Thu Oct 24, 2002 4:12 am
x 1
Contact:

Post by stodge »

Hey that's pretty cool!
What does the debugger tell you? You *are* using a debugger, right??
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

Cool, I've moved this to Showcase.
User avatar
Chris Jones
Lich
Posts: 1742
Joined: Tue Apr 05, 2005 1:11 pm
Location: Gosport, South England
x 1

Post by Chris Jones »

cool 8)

great work! look forward to seeing more in the future! :P
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: RTS style sample app

Post by jacmoe »

DrPain wrote:Well, my TestApp is starting go grow some meat on its bones.
It makes me quite hungry! :P
Quite something: minimap, compass, object selection, ... 8)
User avatar
DrPain
Gnome
Posts: 349
Joined: Tue Jul 05, 2005 2:51 pm
Location: Connecticut, USA

Re: RTS style sample app

Post by DrPain »

jacmoe wrote:Quite something: minimap, compass, object selection, ... 8)
Basic stuff, but it's a start! :)
msm
Gnoblar
Posts: 5
Joined: Thu Sep 01, 2005 10:54 pm

Post by msm »

Looking good.

Does this use one of the Ogre scenemangers (such as PLSMII) or is it one of your own?

Matt
User avatar
DrPain
Gnome
Posts: 349
Joined: Tue Jul 05, 2005 2:51 pm
Location: Connecticut, USA

Post by DrPain »

It uses PLSM2, with minor modifications. All the mods are submitted as patches.
msm
Gnoblar
Posts: 5
Joined: Thu Sep 01, 2005 10:54 pm

Post by msm »

Cool, this is just what i have been planning as well. Not been using ogre for long (was developing my own terrain engine) but moved to ogre so i could focus on the game rather than the engine.
Just finsihed rebuilding my PC so I have not done much woth it, other than mess about with the deformability of the PLSM2 editor, but it looks and feels like a good scenemanager.

Is your test app available for download or is it just some screenshots atm?

Matt
User avatar
DrPain
Gnome
Posts: 349
Joined: Tue Jul 05, 2005 2:51 pm
Location: Connecticut, USA

Post by DrPain »

This version of the TestApp is not quite ready for download yet.
There's a couple more things to work out, then I'll post it.
Probably a couple days work and it'll be ready.
User avatar
DrPain
Gnome
Posts: 349
Joined: Tue Jul 05, 2005 2:51 pm
Location: Connecticut, USA

Post by DrPain »

Well, I think my "Sample RTS App" is ready to be released into the wild.
I started a Wiki page for it, but it's not linked into the main page yet.
Download links available on the Wiki.

http://www.ogre3d.org/wiki/index.php/RTS_Sample_App

Feedback and bug reports are more than welcome.
Last edited by DrPain on Wed Oct 05, 2005 1:22 am, edited 1 time in total.
msm
Gnoblar
Posts: 5
Joined: Thu Sep 01, 2005 10:54 pm

Post by msm »

Fantastic. I will download it and take a look when i get a bit of time.

Matt
gedimaster
Halfling
Posts: 99
Joined: Sun Sep 11, 2005 6:34 am

Post by gedimaster »

hi drpain,

strangely, your release of testapp is around 5 Oct but this function ImagesetManager::getSingleton().createImagesetFromImageFile() is not in-sync with ogre1.0.5's cegui.

instead of createImagesetFromImageFile(), imageset now uses createImageset() which makes specifying imageset name difficult.

may i know if you've tried building it with 1.0.5? and how can i get over this "imageset" problem?
User avatar
DrPain
Gnome
Posts: 349
Joined: Tue Jul 05, 2005 2:51 pm
Location: Connecticut, USA

Post by DrPain »

Well, as I stated in the other thread, this code was built with 1.0.4 and will have the same problems with 1.0.5.
I'll fix this code probably today or tomorrow and post here when it's ready.
gedimaster
Halfling
Posts: 99
Joined: Sun Sep 11, 2005 6:34 am

Post by gedimaster »

i'll check it up tomorrow morning (time here) and try building it with 1.0.5. thanks a bunch drpain. i'm writing a simple game and learning from you minimap example. will certainly include you in the credits! :D
User avatar
DrPain
Gnome
Posts: 349
Joined: Tue Jul 05, 2005 2:51 pm
Location: Connecticut, USA

Post by DrPain »

All updated to CEGUI 1.0.5.
Check the wiki page in the Downloads/History section for links.

New addition: NotificationsOverlay.
The wiki has details.
gedimaster
Halfling
Posts: 99
Joined: Sun Sep 11, 2005 6:34 am

Post by gedimaster »

really strange, from your update console.cpp still uses

Code: Select all

ImagesetManager::getSingleton().createImagesetFromImageFile(..)
but i'm compiling against ogre 1.0.5's cegui that complains createImagesetFromImageFile(..) no longer exists... and is replaced by createImageset(...)

any idea?
gedimaster
Halfling
Posts: 99
Joined: Sun Sep 11, 2005 6:34 am

Post by gedimaster »

hi drpain, i noticed the cegui in ogre's 1.04/1.05 dependency package is not up-to-date with cegui 0.4, hence the difference in createimagesetXXX().

i still managed to build my application in ogre 1.0.4 and with cegui 0.4. but i could not understand why this line keeps crashing:

Code: Select all

CEGUI::SchemeManager::getSingleton().loadScheme((CEGUI::utf8*)"TaharezLook.scheme");
the crash point is very low level, at free.c (HeapFree(..))

i noted from your source code console.cpp that this is old. you're using TaharezLookSkin instead.

what could have caused the crashing?
User avatar
DrPain
Gnome
Posts: 349
Joined: Tue Jul 05, 2005 2:51 pm
Location: Connecticut, USA

Post by DrPain »

gedimaster wrote: i noticed the cegui in ogre's 1.04/1.05 dependency package is not up-to-date with cegui 0.4
Yes, Ogre is not current with CEGUI. If you're going to build to the 1.0.5 version,
you must copy the include and library files from CEGUI into Ogre's dependancy directory.
Sorry, I assumed you knew that if you were already using 1.0.5.

As for the crash, are you really building my new code against the old version of CEGUI?
I'm surprised you could get it to compile.
I think you've got some mixed up versions there.

I just noticed that I had AUTO_RESTORE_CONFIG set to 1, so the pop-up dialog won't show.
If you don't have a copy of Ogre.cfg from a previous run, that could cause a crash.
Set that to zero and recompile, or copy Ogre.cfg from another project.
gedimaster
Halfling
Posts: 99
Joined: Sun Sep 11, 2005 6:34 am

Post by gedimaster »

drpain, can you email me the ogrepaneloverlayelement.h/.cpp files because i'm familiar with how to update my files with the patch you've submitted.

i tried checking out the cvs bleed version of them but your patch is not updated there.

appreciate your pointers.
User avatar
DrPain
Gnome
Posts: 349
Joined: Tue Jul 05, 2005 2:51 pm
Location: Connecticut, USA

Post by DrPain »

gedimaster has reminded me that I had made some changes to the ogrepaneloverlayelement files, adding the setUV function.
The function is very simple, so I'll just post it on the wiki page.

http://www.ogre3d.org/wiki/index.php?ti ... bmit#setUV

*EDIT*
Actually, a patch had been submitted back on 9/27/05 to add this to the overlayelement class.
I took a look at it to refresh my memory, and it was a little more complicated than I had recalled.
So I removed that section from the wiki, and will just recommend using the patch I had submitted.
It was listed on the wiki all along.

I did add one more thing I had forgotten. The additions I had made to the file SDL_keysym.h. That's now on the wiki, just after the list of patches.
akinkhoo
Gnoblar
Posts: 13
Joined: Mon Oct 10, 2005 8:08 pm

Post by akinkhoo »

is this sample no longer available? :(
Quall
Greenskin
Posts: 146
Joined: Wed Apr 06, 2005 11:55 pm

Post by Quall »

Most likely, but you might want to look at this instead
http://www.ogre3d.org/phpBB2/viewtopic. ... hlight=rts
User avatar
DrPain
Gnome
Posts: 349
Joined: Tue Jul 05, 2005 2:51 pm
Location: Connecticut, USA

Post by DrPain »

It is still available. The 10/04 Initial Release is not there, but the 10/20
Full release is there. I'll update the wiki with this information.
User avatar
siddhant
Kobold
Posts: 27
Joined: Sat Nov 03, 2007 6:52 am

understanding RTS sample App

Post by siddhant »

Hi all,

I want to understand RTS sample App's console class code to implement a similar functionality (offered by console class) in my project.

My problem is that being new to OGRE and 3D programming i am not able to understand the purpose and implementation of many things for e.g triangle2D class is still a mystery for me ( all i understand is that it generate meshes that can be rendered on the screen and thats all).


Questions that i have are as follows :-

i) What knowledge should i possess to get a thorough understanding of the code . I have gone through basic , intermediate and advanced ogre tutorials + practical application article and this all the knowledge that i have in the field of OGRE and 3D programming.

ii) I want to port the code so that it is compatible with OGRE 1.4 and also it can be build with visual studio 2005. Please guide me for making the changes that should be done for the above.

Eagerly waiting for a reply

--siddhant
Post Reply