Show Posts

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.


Messages - Trovaner

Pages: 1 ... 32 33 34 35 36 37 38 [39] 40 41 42 43 44 45 46 ... 64
761
Stock Showcases / Re: Robo-Trons (intro videos for your robots)
« on: September 04, 2012, 05:19:36 PM »
A while back, I had an idea of making custom in-game intros based on something like bot bindings. This would eliminate the need for a game recorder while at the same time allow people to be creative with how their bots are presented. Things like camera angle (simplified), camera position, speed, music, and bot actions could be automated to occur in a predefined sequence.

762
It appears to be working correctly now.

763
It isn't hard-coded into the EXE so this is completely fix-able. All you need to do is override the SuperAI's "Throttle" and "Turn" methods by including your own version inside of your AI.py (don't edit the actual SuperAI's code inside of the AI/__init__.py).

Code: (OmniReversible.py) [Select]
from __future__ import generators
import plus
import AI
import Gooey
import Tactics

class OmniReversible(AI.SuperAI):
    "Omni strategy that doesn't switch directions when inverted"
    name = "OmniReversible"
   
    def __init__(self, **args):
        AI.SuperAI.__init__(self, **args)
       
        self.zone = "weapon"
        self.triggers = ["Fire"]
        self.trigger2 = ["Srimech"]
        self.reloadTime = 0
        self.reloadDelay = 3
        self.escapeDuration = int(2/self.tickInterval) #2 seconds
       
        self.spin_range = 3.0
       
        if 'range' in args:
            self.spin_range = args.get('range')
       
        if 'triggers' in args: self.triggers = args['triggers']
        if 'reload' in args: self.reloadDelay = args['reload']
        if 'escapeDuration' in args: self.escapeDuration = int(args['escapeDuration']/self.tickInterval)
       
        self.triggerIterator = iter(self.triggers)
       
        self.tactics.append(Tactics.Engage(self))

    def Activate(self, active):
        if active:
            if AI.SuperAI.debugging:
                self.debug = Gooey.Plain("watch", 0, 75, 100, 75)
                tbox = self.debug.addText("line0", 0, 0, 100, 15)
                tbox.setText("Throttle")
                tbox = self.debug.addText("line1", 0, 15, 100, 15)
                tbox.setText("Turning")
                tbox = self.debug.addText("line2", 0, 30, 100, 15)
                tbox.setText("")
                tbox = self.debug.addText("line3", 0, 45, 100, 15)
                tbox.setText("")
           
            self.RegisterSmartZone(self.zone, 1)
       
        return AI.SuperAI.Activate(self, active)

    def Tick(self):
        # fire weapon
        if self.weapons:
           
            # spin up depending on enemy's range
            enemy, range = self.GetNearestEnemy()
           
            if enemy is not None and range < self.spin_range:
                self.Input("Spin", 0, 1)
            elif self.GetInputStatus("Spin", 0) != 0:
                self.Input("Spin", 0, 0)
           
            targets = [x for x in self.sensors.itervalues() if x.contacts > 0 \
                and not plus.isDefeated(x.robot)]
           
            # slight delay between firing
            if self.reloadTime > 0: self.reloadTime -= 1
           
            if len(targets) > 0 and self.reloadTime <= 0:
                try:
                    trigger = self.triggerIterator.next()
                except StopIteration:
                    self.triggerIterator = iter(self.triggers)
                    trigger = self.triggerIterator.next()
               
                self.Input(trigger, 0, 1)
                self.reloadTime = self.reloadDelay
       
        return AI.SuperAI.Tick(self)

    def InvertHandler(self):
        # fire all weapons once per second (until we're upright!)
        while 1:
            for trigger in self.trigger2:
                self.Input(trigger, 0, 1)
           
            for i in range(0, 8):
                yield 0

    def LostComponent(self, id):
        # if we lose all our weapons, stop using the Engage tactic and switch to Shove
        if id in self.weapons: self.weapons.remove(id)
       
        if not self.weapons:
            tactic = [x for x in self.tactics if x.name == "Engage"]
            if len(tactic) > 0:
                self.tactics.remove(tactic[0])
               
                self.tactics.append(Tactics.Shove(self))
                self.tactics.append(Tactics.Charge(self))
       
        return AI.SuperAI.LostComponent(self, id)

    def Throttle(self, throttle):
        # if we're car steering and we're not moving much, throttle up
        if self.bCarSteering and self.last_turn_throttle != 0:
            speed = self.GetSpeed()
            if speed > 0 and speed < self.top_speed / 3: throttle = self.last_throttle + 10
            elif speed < 0 and speed > -self.top_speed / 3: throttle = self.last_throttle - 10
       
        throttle = min(max(throttle, -100), 100)
       
        self.set_throttle = throttle
        self.Input('Forward', 0, throttle)
        self.DebugString(0, "Throttle = " + str(int(throttle)))

    def Turn(self, turning):
        if self.bInvertible and self.IsUpsideDown(): turning = -turning
        turning = min(max(turning, -100), 100)
       
        self.set_turn_throttle = turning
        self.Input('LeftRight', 0, -turning)
        self.Input('LeftRight', 1, turning)
        self.DebugString(1, "Turning = " + str(int(turning)))

    def StuckHandler(self):
        "This generator is called when the bot is almost immobile."
        while 1:
            # back up for 2 seconds (will stop once we're not immobile)
            for i in range(0, self.escapeDuration):
                self.Throttle(-100)
                yield 0
            # go forward for 2 seconds
            for i in range(0, self.escapeDuration):
                self.Throttle(100)
                yield 0

    def DebugString(self, id, string):
        if self.debug:
            if id == 0: self.debug.get("line0").setText(string)
            elif id == 1: self.debug.get("line1").setText(string)
            elif id == 2: self.debug.get("line2").setText(string)
            elif id == 3: self.debug.get("line3").setText(string)

AI.register(OmniReversible)

Edit: Everything is fixed now. By request, I also added a binding called "escapeDuration" so that you can set how long the AI should attempt to move in any one direction when it is being counted out. The default behavior was and is to move backwards for 2 seconds then forward for 2 seconds then repeat.

764
Modifications / Re: In need of an arena.
« on: August 23, 2012, 06:40:22 PM »
Unfortunately, I've been much busier than expected over the last couple weeks so this arena isn't quite ready yet. I will however continue working on it and get it shipped out ASAP.

765
Modifications / Re: RAW 2 Arena released!
« on: August 14, 2012, 03:20:58 PM »
Wow, its been awhile since I last looked at this arena. I vaguely remember working on chunks of it.

766
Discussion / Re: Arena Ideas - Post 'Em Here!
« on: August 12, 2012, 05:55:12 PM »
We need more KOTH and tabletop maps.
I completely agree. Although, I've actually used the KOTH mode for quite a few of my arenas because it is the only mode that doesn't give points for damage (ideal for racing, soccer, jousting, and other special game styles). The points in the KOTH arena come from just a few lines of python code so it gives us the potential to create our own rules on an arena-by-arena basis.

There are also several arenas that are Tabletops but weren't labeled as such. The Fight to the Finish Arena, Ocean Platform, and Ant Latenight Rumble could all be considered tabletops.

RA2 has no hard-coded distinction between Battle Royale, Tabletops, and Obstacle Course modes. As such, the modes have become highly blurred (for example, OOTA's still occur in arenas that aren't tabletops). In my version of RA2, I've been trying to differentiate them more but that makes my version incompatible with other people's mods. Team and Deathmatch are pretty much limited to their namesakes but KOTH is useful for many specialized purposes. I'm also treating Battle Royale as enclosed arenas, Tabletop as open arenas, and Obstacle Course as 1vs3. There is still quite a bit of overlap but I find it to be distributed more evenly and it adds a few features that weren't previously available.

IIRC, Click was going to turn the Obstacle Course mode into a racing mode for DSL3. Doing this would preserve reverse compatibility but would make any future transition more difficult.

767
Modifications / Re: In need of an arena.
« on: August 12, 2012, 04:40:36 PM »
I don't mind holding off on the submitting to the public but I don't think ms paint supports transparency. I have a rough skin that uses TGA files for the inner walls, cages, and audience. If you would like me to skin it, it will take an additional week (I'm trying to fit this into my busy schedule).

768
Modifications / Re: In need of an arena.
« on: August 10, 2012, 09:44:17 PM »
I took a look and it appears as though I still have a problem with overlapping transparencies. As far as time goes, I could get it done within a week (assuming that the problem can be resolved). There might also be an issue with the cages jamming but I couldn't spend much time testing this.

Does JoeBlo still want to skin it?

769
Modifications / Re: In need of an arena.
« on: August 09, 2012, 11:28:48 PM »
I haven't touched RA2 in ages so I can't remember if I made much more progress on it. I'll see about blowing the dust off of RA2 tomorrow and try to come up with a time frame.

770
Discussion / Re: Special effects for robots (lights, music, etc)
« on: July 18, 2012, 01:45:18 PM »
IIRC there have been a couple components related to lights. For example, a lightbar component has been made (by either Darkrat or ACAMS). As far as projecting light, the closest thing would be to have a mesh that doesn't collide with anything (like the one used by the laser in Firebeetle's component pack). Unfortunately, this method wouldn't work well for strobe lights because you can't remove the mesh.

There are however a couple workarounds if you are willing to make a custom Arena or AI for the bot(s). In the same way that I made part of the robot invisible in my Online Arena, you could toggle the visibility of a single component (the light).
  • From either the AI or the Arena, you can monitor the status of a switch/analog/button. The caveat is that it wouldn't work for human players because there is, currently, no way of looking at their input statuses (the sergepatcher may be able to do this but I haven't had any luck with it).
  • In addition to the one above, you could make one of the camera's turn the light on/off for human players (Arena.py only). Unfortunately, the only working example of this that I have released is the Online Arena but I can help future proof it (the way that I did it doesn't support the action cam that I created and I have yet to release the update for it)
  • From either the AI or the Arena, you can track when a wheel (it doesn't have to look like one) touches the something that isn't attached to the bot. Looking past the obvious issues with complexity and airtime, this method has some benefits. For one thing, it would work for both humans (Arena.py only) and AI (either Arena.py or AI.py) without anything special. However, the best thing about it is that it wouldn't affect bots that didn't have a light on them.
I would be glad to help if you need any assistance with this.

771
General Support / Re: How to Calculate Damage Points?
« on: July 10, 2012, 01:39:27 PM »
Damage =/= Points. Each of them have their own formula.

772
Stock Showcases / Re: Geice's Stock Showcase
« on: June 30, 2012, 06:22:00 PM »
That's a really cool looking design. You could probably make the plows a little more durable if you moved the casters out a little more. 

774
General Support / Re: PYS AI problem?
« on: June 12, 2012, 09:28:53 AM »
When version 1.3 starts saying that you need a disk, you just need to replace the EXE file with a fresh copy IIRC.

775
Discussion / Re: RW:ED Arena Plan View Image
« on: June 08, 2012, 03:50:45 PM »
Considering how many people are interested in this, we should try to turn it into a cooperative mod. Personally, I don't have the time to do it by myself but I would be willing to lend my assistance/expertise. The more people that would be willing to help, the faster and easier it will be to make it. Regardless of how much knowledge of modding you have, your assistance would be much appreciated (as long as you are willing to learn a few simple things).

It might also be easier to start from scratch as opposed to using the current one. I know that I was helping Thyrus to make a more realistic version but its been awhile and I don't remember us getting very far (I was just showing Thyrus the basics). I've also been planning to add the housebots to any of the RW Arena's renditions but, as previously mentioned, I've been kinda busy.

776
Modifications / Re: The DSL 3.0 preview thread
« on: May 12, 2012, 01:32:32 PM »
As powerrave mentioned, having all or nothing in terms of weapons makes it easier to balance things. Also, AFAIK there is no limit to the number of normal directions. If I'm right, this means that things like razors can have all three edges and the point deliver damage without the flat sides doing anything special.

777
Discussion / Re: Graphics Improvements
« on: May 09, 2012, 12:56:50 PM »
Due to time constraints, Serge put his high resolution skins on the back burner. Once that thread got buried, I decided to make my own but I only did half of the components. Looking back, I would have to say that mine look pretty amateur compared to his but I'm sure I could do better now if I had the time/motivation to do so.

As for the screenies, isn't that a setting in the CFG? I know there is at least something similar there. Personally, I think it looks over-saturated and you lose the finer details of the arena's skin but it does come down to personal preference.

Its cool that your diving into the dark depths of the EXE and hopefully you have more success than the rest of us.

778
General Support / Re: Why? D:
« on: April 24, 2012, 09:36:44 PM »
The only way to fix it in RA2 would be to BFE it.

Since models are made up of faces consisting of 3 vertices and 3 edges (in lamens terms, a face is a triangle in 3D space), you can conclude that the edges are using rotational symmetry as opposed to reflection symmetry. If I had to guess, the game is likely creating the chassis based off of the order in which the points were connected as opposed to where they are on the chassis design grid. Doing it this way, it would have taken less work to code the 3D modeler than evaluating the placement of everything using some complicated algorithm.

I've actually run into this a lot whenever I mod GMF files. Most 3D modeling programs also do this but it is usually just a matter of seconds to fix it within them.

779
General Support / Re: Use custom music
« on: April 22, 2012, 09:20:04 PM »
I personally prefer to play music in the background using a music player.
Alternatively, you can...
-copy the music code from the Music Box Arena and put it in "Arenas/__init__.py" to get it to play songs only during battles. This would be a much easier solution (than the latter alternative) but getting specific arenas to play certain tracks wouldn't be as easy to do.
-copy the music code from the Music Box Arena and put it in every Arena.py to to get every arena to play its own unique song. More work but it would allow you to theme specific arenas.

At the moment, I don't have the time to record a video or write the code for you but it wouldn't be too difficult to figure out on your own. Just compare the combat arena's code to the music box's code.

780
Other Tutorials / Re: How to get a N64 3D level into a RA2 arena
« on: April 15, 2012, 12:27:43 PM »
I, or somebody else, should finish writing a blender script for exporting to GMF.

Pages: 1 ... 32 33 34 35 36 37 38 [39] 40 41 42 43 44 45 46 ... 64