Game Development Community

Buildings Stalk Pedestrians!

by John McGlamory · in RTS Starter Kit · 11/13/2004 (4:22 pm) · 22 replies

Sorry for the quirky title, but I felt like being a tad bit humorous considering this possible bug I've located.

This is my first post on the GarageGames messageboards, so please forgive me if I break any of the old laws passed on by word of mouth. Also, I am sorry if this has been posted in this forum before, but I looked and could not find it.

Playing around with the demo for the RTS Kit, I've come across a rather interesting "feature". I've used all the basic functions of the demo so far, including building structures. Currently the structures have no command menu, so I went on with my explorations. I was tinkering with the group assignments and got the wild hair to make a shortcut back to my 'base' by assigning a group to a building.

I sent my small team out wandering the map and decided to go back to base, so I pressed the key that was attached to my building group and to my surprise, the building was given a command menu... including the attack command. Well, me and my little devious self decided to try it on one of my closer units. Lo and behold, the building began to stalk towards the unit and proceeded to eat the hapless rifleman just like that old Monty Python animation where houses came to life and prowled the streets and began eating people! Needless to say I started laughing hysterically.

Aside from this being a possible bug, I thought this could also be useful such as making moving buildings ala-Terrans from StarCraft... albeit unit-consuming buildings.

Anyways, I just thought I'd share my small discovery with everyone else who has bought the pack. The quirk fondly reminded me of one of my favorite old Monty Python skits. :)

About the author

I am mainly an artist, but I love tinkering with engines like T3D, TGEA, TGE, T2D, Leadwerks and ShiVa. I know enough about scripting and coding to follow good directions.

Page «Previous 1 2
#1
11/13/2004 (5:14 pm)
Heheh..that's a great catch, and definitely hilarious! Going to have to try it out myself.

Actually, now that I think about it, I seem to remember something about someone mentioning this actual behaviour, for a sort of poor man's siege equipment--buildings (catapults, trebuchets, battering rams) being "buildings", but able to move without having to concern yourself with Vehicle.cc.

Sounds more and more like an unexpected application of a design feature as I think about it...
#2
11/13/2004 (7:32 pm)
Just a little bit of unharnessed potential in the pack... Bear it no mind. ;)

Speaking technically, RTSBuilding is just a subclass of RTSUnit, with 99% the same functionality. So there's actually quite a lot of power in them. :)
#3
11/14/2004 (2:28 pm)
Hehe, nice write-up. :)

We actually designed it like this though, so that you could have buildings that would get up and be units, if you wanted (eg the Night Elf base trees in War Craft 3, or command centers for terrans in StarCraft, exactly).

We didn't flesh it out with an example though... there's actually a lot of "hidden" functionality like this. We just didn't have time to create good, polished examples demonstrating all the features.

It's also easy to disable this functionality for your buildings. We wanted it to be possible (discussed it specifically in the design meetings), but of course didn't want to force it on anyone.
#4
11/14/2004 (2:36 pm)
I knew the buildings were a child of the main RTSUnit class, but I wasn't expecting to have a building march off and start munching on units in the example. :) I will admit that this 'hidden feature' will make it easier for non-programmer types, like me, to add in mobile buildings. To think, my accidental discovery that you can hit the group button twice in a row to center over your assigned group would lead me to find a hungry factory.

I rather enjoyed that little finding. Perhaps this could be used in a game and have them called 'Camo Units'. Buildings that are actually units and will sneak up and attack much like how crocodiles sneak up to drinking antelopes at watering holes. :)

Edit:
Well, with a bit of free time, inspiration mixed with confusion at wondering which unit I have selected when looking elsewhere in the map, I have created some new avatar portraits and decided to share.

muro.ygingras.net/rts/riflemanPortrait.pngRifleman
muro.ygingras.net/rts/shockerPortrait.pngShocker
muro.ygingras.net/rts/boneCrackerPortrait.pngBoneCracker Bot
muro.ygingras.net/rts/buildingPortrait.pngBuilding

Zip Containing All Portraits

Also, I noticed when you would assign a building to a group to select and move it, or select the building using the rubber band selection along with some other units, the portrait that would be displayed would be the BoneCracker's. Here is a real simple fix to at least get the right portrait. I could be doing this in the completely wrong manner, so feel free to correct me. :)

First, in client\scripts\playGui.cs, in the GuiRTSTSCtrl::getTypeID function:

After:
      case "riflemanBlock":
         return 2;
Add:
      case "TestBuildingBlock":
         return 3;

Next, in the following function:

After:
      case 2:
         return "starter.RTS/client/ui/selectionDisplay/riflemanPortrait";
Add:
      case 3:
         return "starter.RTS/client/ui/selectionDisplay/buildingPortrait";

(Using my buildingPortrait.png, of course. ;) )

That should do it. This will not cause a command menu to pop up with the portrait when you click on the building, it will just cause the portrait to appear when you group select it with actual units or cause it to be shown when you perform the grouping exploit I found earlier.

I hope this works. This being my first 'resource' of any kind, I am not holding out complete hope. :)
#5
11/14/2004 (10:08 pm)
Thanks a ton, J. Is it OK for us to use those images in our starter app? (I have to ask for legal reasons. :)

I've also put this on my todolist for RTS... Good spotting!
#6
11/15/2004 (4:01 am)
@J

Tried to download these but the link says I'm not authorized. Looks like your own site and not GG so I'm sure everyone else will have the same issue.

Edit: Never mind - darn firewall rule was preventing it. I'm all set. Thanks all.
#7
11/15/2004 (4:44 am)
@Jeff L: try downloading the .zip file on the link, worked fine for me.
#8
11/15/2004 (7:13 am)
Ben:
Sure, I'd actually be honored to have my little addition used. Go right ahead. :)

Jeff:
Right clicking and saving the images or the zip file individually (I just did here from work with no problems) should work. Aside from that, I am not sure why you'd be having problems. Sorry. I could email it to you if you have further problems.
#9
11/15/2004 (7:17 am)
Haha, I find this amusing... I modelled a killer building. Go me :D
#10
11/15/2004 (7:07 pm)
@John:
Did you have to make any changes to playGui.gui ?

I dropped your images in, but the only one that ever gets displayed for me, regardless of the unit type is the boneCrackerPortrait.

It's almost certainly a problem with my integration, but I've yet to track it down..
#11
11/15/2004 (7:11 pm)
Stephen:
No, no changes to the gui file. I just dropped the images in the selectionDisplay directory. The only changes I did to script was the ones I mentioned earlier.

Craig:
Yeah, you did make a killer building. :) Working on making one of my own right now, between reskinning the in-game gui.
#12
11/15/2004 (7:52 pm)
Quote:Yeah, you did make a killer building. :) Working on making one of my own right now, between reskinning the in-game gui.
Oh my gawd please tell me how to get the console window back to a white background :(.

Hehe...have my brain wrapped around so many things I can't seem to figure out where it's being overridden to that color. It's not a bad color scheme overall, but I can't see error messages in console.
#13
11/16/2004 (3:52 am)
John, thanks much for the portraits and the portrait fix. Woot!

Stephen, the console isn't white for you?
#14
11/16/2004 (3:56 am)
No, lol. you mean that wasn't intentional? It's the same color as the rest of the "theme", a medium, rusty red. It's actually not that bad, except that warning messages are currently in grey, and impossible to read.

Hmm, ok guess that is a problem on our side then, will get on it!
#15
11/16/2004 (1:59 pm)
Stephen:
Oh, I meant I am just changing all the pngs related to the in-game gui, such as the background for the map/radar, the command menu and the unit selection menu.

If I get done with it, I may post it in the resources section so people can have it, too, if they like it.

By the way, thanks for the formations and speed resource. I'll work on adding it in soon.
#16
11/16/2004 (2:08 pm)
@John: sorry, my "that wasn't intentional?" comment was to Josh regarding the fact that I have a rusty red console window now...

I haven't gotten to actually see your resource working yet (interestingly, putting it in is basically what clued me down the path of our dataBlocks being broken atm, since only the bonecracker one ever displayed).
#17
11/16/2004 (2:31 pm)
Stephen:
Wow, I was an indirect help. This RTS Pack is making me feel all warm and fuzzy and useful inside. :)

Your project sounds very interesting. I can't wait to hear and see more about it.
#18
11/16/2004 (2:38 pm)
@John: Thanks--we're a -long- way away. Right now we're basically building our toolset to accomplish the various systems we want, like persistent store, account management, lots of little enhancements like moveable gui windows, tooltips, all of the high performance functionality that the RTS pack has (that was a -very- big thing for us--we had implemented some of this stuff, but not nearly with as much expertise as GG has), setting up the calendar/day night cycles, etc.

One of the benefits of doing things piecemeal like this is that it keeps us from attempting the -really- big stuff until we get a better level of expertise with the engine. Even though I finally hit a wall, I learned more about the engine, scripting, console-engine interface, and client/server model in the last 6 days then I had in at least the previous 6 months!

And I agree with Josh--the atmosphere here so far is outstanding...I think there has been a higher amount of content and cooperation here in this set of forums than the rest of the forums see in months!
#19
11/16/2004 (3:14 pm)
Thanks guys, got this fix in the pack now! Looks awesome. :)
#20
11/16/2004 (5:40 pm)
Stephen:
GMail wouldn't let me attach the zip file with the buttons I told you I'd make for your resource, so I thought I'd continue with the tradition of putting my buttons in this thread. :)

Based off the buttons from the current example so they wouldn't stick out like a sore thumb.

Double Line Formation:
muro.ygingras.net/rts/lineform_h.PNGmuro.ygingras.net/rts/lineform_i.PNGmuro.ygingras.net/rts/lineform_n.PNGmuro.ygingras.net/rts/lineform_d.PNG
Box (Square) Formation:
muro.ygingras.net/rts/boxform_h.PNGmuro.ygingras.net/rts/boxform_i.PNGmuro.ygingras.net/rts/boxform_n.PNGmuro.ygingras.net/rts/boxform_d.PNG
Zip Containing All

I may redo them later, but right now I am on a roll reskinning the command window. I want to see where this creative wave takes me. :)

Edit: Actually, I am already having ideas for these buttons.

Edit-Edit: I really need to quit editing my posts as much as I do. Oh well, I'm a pseudo-perfectionist, so.... lol.
Page «Previous 1 2