141
Discussion / Re: Really Odd Question
« on: July 10, 2015, 12:57:49 PM »
There used to be an RA2 worksheet on some school's website but it got taken down years ago. I might still have a copy of it, though...
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to. 141
Discussion / Re: Really Odd Question« on: July 10, 2015, 12:57:49 PM »
There used to be an RA2 worksheet on some school's website but it got taken down years ago. I might still have a copy of it, though...
142
Contests / BOTM August 2015« on: July 08, 2015, 11:27:49 PM »
For August, I'm thinking Stock MW.
Here's how this works. Every participant creates a bot that follows the given bot restrictions for that month. They then create a simple splash for their bot and uploaded it to GTM's BOTM Uploader before the deadline expires. After the deadline expires, a poll will be created for the community to vote on their favorite entry. At the end of the month, the splash with the most votes will be put on GTM's homepage for a month. Bot Restrictions
Splash Rules
Please upload your entries using the BOTM Uploader. Questions/comments? 143
Contests / Re: Vote BOTM July 2015« on: July 08, 2015, 11:09:33 PM »
Congratulations, MassimoV for winning July's BOTM!
144
Contests / Re: Vote BOTM July 2015« on: July 06, 2015, 12:57:19 PM »
Oops, I thought I removed #2... Since it broke nearly every rule, it has been DQed.
145
Contests / Vote BOTM July 2015« on: July 05, 2015, 11:27:29 PM »
Once again, it seems that I forgot to post this... I'll probably create a reminder so that I don't do this as often in the future.
#1 090901 ![]() #2 (DQed) #3 MassimoV ![]() #4 RedAce ![]() 146
Discussion / Re: Commentator mod?« on: June 21, 2015, 12:33:53 PM »
I think you could do it in a way that wouldn't seem repetitive but you would almost have to add the code to every arena for it to be in relation to hazards. It wouldn't be that hard to keep track of components on bots but, if you want to know when weapons a fired, it would have to be part of the AI. Comments like "I didn't think motors were optional" when a bot loses a motor would be pretty easy to add for all bots in all arenas if you added the monitoring code to Arenas/__init__.py.
147
General Support / Re: How to rotate starting points?« on: June 14, 2015, 08:14:09 PM »
Let me know if this thread helps.
148
Tutorials and Tips / Re: Creating Arena Hazards« on: June 14, 2015, 08:10:47 PM »
This is still pretty rough around the edges but I'll try to improve on it over time...
Feel free to leave your comments/questions here. 149
Tutorials and Tips / Re: Creating Arena Hazards« on: June 14, 2015, 08:07:36 PM »
Objects
Basically, this category is comprised of things like flippers, loose objects, compressors, etc. For the sake of simplicity, we are going to break this up into four groups based on how they move: static, loose, linear, and angular. We'll also only be looking at the *GMID_HAVOK_RBCOLLECTION and *GMID_HAVOK_CONSTRAINTSOLVER sections of the GMF since the rest doesn't really matter as long as you have the objects named the same as me. Static Just in case it wasn't already obvious, this group is made up of things that don't move. Things like spikes, walls, bouncy floors, inverted control floors, etc. fall into this group. Here is a simple example of a non-moving spike. Code: (Static Spike GMF Example) [Select] *GMID_HAVOK_RBCOLLECTION This can be part of the Arena.gmf or be in its own file (like the ramps that get loaded into the Practice Arena). The reason why it doesn't move has to do with the fact that it weighs 0kg. Alternatively, you can assign a weight to it and set it *UNYIELDING equal to 1 (which means true).Alright, so what would you do if you wanted it to play a sound and deliver more damage? Code: (Static Spike PY Example) [Select] def HazardsOn(self, on): The key piece here is that we are telling the game that the spike object should be treated like metal and 0.8 damage. The sound effect is played whenever the spike hits something. If we set the material to rubber, there wouldn't be any damage delivered but we would still be able to play the sound effect. I should also note that the below commands are used by all the different object groups but they are especially important for static hazards since they have no movement of their own.Just for reference, here are the commands specific to object hazards that you can use for more than just the static objects. Code: (Object Commands) [Select] #self.AddXtra(ObjectName, GMF, Alloy) Loose Things like cones, barrels, and cinderblocks fall into this group. The only real difference between a static object and a loose object is that the loose object has mass and unyielding set to false. Code: (Loose Crate GMF Example) [Select] *GMID_HAVOK_RBCOLLECTION There are two gotchas that you should be aware of:
Code: (Loose Crate PY Example) [Select] def HazardsOn(self, on):
Linear This group is made up of things like compactors, pit covers, lifts, rivers, etc. Many of these types of things have been coded inside of Hazards.py. You just have to make sure that the moving part is what we defined as loose in the previous group. Code: (Prismatic Spike PY Example) [Select] def HazardsOn(self, on): The "base" (parent object) is the part that "spike" (child object) is moving relative to. Usually we use an object that is static for the parent and something that it loose for the child but they could both be loose if you wanted it to move around (like if it was on a GMF housebot).A good example of the above can be found in king.py. I should probably also point out that RA2 is using the word "prismatic" as if it is synonymous with "actuator" (perhaps they were thinking of "pneumatic"...). Correct me if I'm wrong but I don't think that this is accurate terminology. Here are all of the commands specific to prismatics. Code: (Prismatic Commands) [Select] #self.AddPrismatic(ParentObjectName, ChildObjectName, X_Direction, Y_Direction, Z_Direction, MovementLimit1, MovementLimit2, 0) - Creates a PrismaticController object. Angular This group is made up of everything from hammers to spinning blades. Code: (Spinning Saw GMF Example) [Select] *GMID_HAVOK_CONSTRAINTSOLVER Basically, the above code is saying that our child object ("saw") is going to be moving around the Y axis of the parent object ("base"). We also set *IS_LIMITED to false so it can move 360 degrees around the spin axis. Once again, the parent is usually set to a static object and the child is always set to something loose but you could have the parent be loose as well. Another thing worth noting is that we called our hinge constraint "Hinge01" so we'll be using that when we finally apply some torque.With just the above and no python code, you have the equivalent to an axle mount component. If we need it to spin on its own, you'll need to have something like the following in your Arena.py. Since Hazards.py doesn't include a hazard for continuously spinning an object, I'll code one of those. Code: (Spinning Saw PY Example) [Select] def HazardsOn(self, on): In the above, we're basically telling RA2 that our hinge should rotate and not be locked at any point in time.If you wanted to create a something with a limited swing, you would just set *IS_LIMITED to true (1) and adjust the *ANGLE_LIMITS accordingly. You would also need to add code for going back and forth instead of in one direction unless you take advantage of gravity or use one of the many pre-coded options found in Hazards.py. Last, but not least, here are all of the hinge commands that I could dig up. Code: (Hinge Commands) [Select] #self.GetHinge(HingeName) - Creates a HingeController object.
150
Tutorials and Tips / Re: Creating Arena Hazards« on: June 14, 2015, 08:07:25 PM »
Effects
In this category, we'll go over the common, hazard-related things that don't require GMF objects to function (unless we choose to have a zone for triggering them). OOTAs I'll list this for completeness and so that you can compare and contrast it with other hazards. Code: (OOTA Example) [Select] def __init__(self): In the above code, we set self.players equal to an empty array (you can think of an array as a list that can't be modified) so that it doesn't crash when RA2 calls the Tick method gets called before the Activate method. In the Activate method, we assign a new array of players to our self.players variable. In the Tick method, we loop through each of the players, check to see if they are located below -5, and eliminate them if they are.If you would like to see a couple examples, flextop.py and G_antweight.py both use something like this. Pits Similar to OOTAs, we can eliminate or deliver damage to bots that fall below some height but let's try a different implementation. Code: (Pit Example) [Select] def HazardsOn(self, on): This time around, we are assigning the "pit_zone" object found in the Arena.gmf to be a zone and eliminating any bot that has a chassis that is touching it.Usually, we do the same thing as we do for OOTA for pits but I was able to remember one example of an arena that did it similar to this. In DSLCaveArena.py, damage is delivered to any bot that falls into the pit but, since ZoneEvent doesn't get called unless there is a change, you only get damaged once (I would consider this broken). If we wanted to fix it, we would have to have something in the Tick method or use a command that only has to be called once. Fire The fire particle effect can be accomplished in one line of code but, in order to have the sound effect and damage, you are going to need a lot more. That said, both Infogrames and the DSL team have already programmed a decent flamethrower inside of Hazards.py and DSLHaz.py that we can use. When I did a quick scan of the differences between the two, I found that DSL is using a slightly quieter sound effect with slightly more damage per tick. For my example, I'll use the one found in stock RA2. Code: (Fire Example) [Select] def HazardsOn(self, on): If you were to stick this in an arena, you would see a flamethrower shooting up from the middle of the arena and driving into it delivers damage. If you wanted to use the DSL version, you can just replace "Hazards.Flame" with "DSLHaz.Flame" and add "import DSLHaz" to the top section. You will also need "import Hazards" at the top of the file by all the other imports or it will crash. Just for reference, here are the commands specific to flames. Code: (Fire Commands) [Select] #plus.AddParticleEmitter(XYZ_StartingLocation, XYZ_EndingLocation, XYZ_Variance) - Creates a ParticleEmitter object that looks like fire. While emitting, the fire moves in the designated direction with some leeway if variance isn't set to (0,0,0) (each value in variance represents the amount of leeway the smoke will have in the X, Y, and Z directions) A good example of this can be found in Bridge.py. If you are just looking for something cosmetic, the Epic Showdown Arena (bbhaz.py) has some really neat torches. Electricity Similar to fire, electricity doesn't actually have any sound effect or damage so we would need to include that in our implementation. Unlike fire, the implementation in Hazards does not include the lightning itself (just the zap effect that you see when you drive over a grate in the Electric Arena). For this reason, I'll start by showing you how to use the electric grates and then we'll go over how to use lightning. Code: (Electric Grates Example) [Select] def HazardsOn(self, on): This will shock any bots that enter into a zone when it isn't recharging.Once again, don't forget to add "import Hazards" to the top section of the Arena.py if it isn't already there. Code: (Lightning Example) [Select] def HazardsOn(self, on): Just for reference, here are the commands specific to electricity. Code: (Electricity Commands) [Select] #self.CreateLightning(LightningID, XYZ_StartingLocation, XYZ_EndingLocation) - Create lightning with the given ID and set the position of both ends. See electric.py for a simple example of using both lightning and electric grates. Miscellaneous Here are a few other commands that you may find useful when creating effect hazards. Code: (Misc Commands) [Select] #plus.emitSmoke(Intensity, XYZ_StartingLocation, XYZ_Direction, XYZ_Variance) - Creates smoke that moves in the designated direction with some leeway if variance isn't set to (0,0,0) (each value in variance represents the amount of leeway the smoke will have in the X, Y, and Z directions).
151
Tutorials and Tips / Creating Arena Hazards« on: June 14, 2015, 08:07:06 PM »
Since the subject of arena hazards is pretty vast, I'll try to break this up into two categories: effects and objects. However, we'll also need to go over a few of the basics before we jump into those.
Table of Contents Basics In the Arena.py file, the lines starting with "def" are called methods and the methods that you will be concerning yourself with are __init__, Activate, HazardsOn, Tick, and ZoneEvent.
Code: [Select] def __init__(self): In Python, everything after the number sign ("#") is a comment unless it is wrapped in quotes so those lines can be completely replaced by your code. The first line under __init__ is basically telling RA2 to call the parent's __init__ method with teh given Arena.gmf. Similarly, the "return" statements found at the bottom of the next three methods are telling RA2 to run the parent's similarly named method (just Google "python inheritance" if you would like to learn more). The last method is sending "True" back to the sender to indicate that the zone event has been handled (you could potentially do "return False" but, for all intents and purposes, we won't). If you don't have one of these defined in your Arena.py, it will just call the parent's equivalent so it would be like having the above code without adding any of your own.For the sake of simplicity, all of my examples will assume that "import plus" and "import Arenas" are in the top section of the Arena.py next to the others. Any other imports will be noted below the code. 152
Discussion / Re: A blast from the past... Checkin' da archives.« on: June 09, 2015, 10:33:28 PM »the old gtm bot exchange (can't download anything tho): http://web.archive.org/web/20070213070417/http://botexchange.gametechmods.com/The UI could have used a bit more polishing but the functionality was pretty awesome. I should really finish working on mine... 153
Contests / Re: BOTM July 2015« on: June 09, 2015, 06:26:34 PM »Is DSL 2 distinct from DSL 2.1?Whoops, I just forgot to include the ".1" 154
Contests / BOTM July 2015« on: June 08, 2015, 01:46:22 PM »
I think its time for another DSL 2 BOTM.
Here's how this works. Every participant creates a bot that follows the given bot restrictions for that month. They then create a simple splash for their bot and uploaded it to GTM's BOTM Uploader before the deadline expires. After the deadline expires, a poll will be created for the community to vote on their favorite entry. At the end of the month, the splash with the most votes will be put on GTM's homepage for a month. Bot Restrictions
Splash Rules
Please upload your entries using the BOTM Uploader. Questions/comments? 156
Discussion / Re: Robot Arena 3!« on: June 04, 2015, 08:26:06 PM »
Honestly, I am flattered that you would say that. Given the chance, I'd do it in a heartbeat but I'm not sure what I'd really be bringing to the table...
As Kill pointed out, they know how we have been using the game and it is unlikely that that they would be taking a step backward. RA2 is over 12 years old and the only reason why it has survived the test of time is because of how much customization it gives you in and out of the game. I doubt they would risk compromising this when they make the third installment. 159
General Support / Re: Stock Botlab Background« on: May 29, 2015, 06:25:24 PM »
Unfortunately, it isn't. In stock, there isn't an image file for the background so depending on the screen, you will have to modify the associated GIB. You can either set the background color manually or add code so that it uses an image file.
160
General Support / Re: AI combing, AI Merging or whatever you'ld call this.« on: May 14, 2015, 10:19:05 PM »
Both.
To combine the AI bots from multiple packs: -You will need to copy/paste the AI.py files (one of each). -You will need to copy/paste/rename the Teams folders. -You will need to merge some of the contents of the Bindings.py files. -You will need to merge some of the contents of the Teams.txt files and correct the team numbers. -You will need to make sure that all of the components used by the AI get copy/pasted as necessary (if a component is modified on one version, it will require quite a bit more work to keep them separate). |