FAQ  •  Register  •  Login

EnderBot

<<

Unknown

User avatar

Posts: 183

Joined: Mon Mar 08, 2010 4:48 pm

Post Fri Mar 12, 2010 3:56 pm

EnderBot

EnderBot - Duel bot with objectives, aggressive - Version 1 Beta 1
Only works with CTF gametype at the gametype at the moment.
Requires a bot nav mesh.

A bug with pathfinding is evident in this bot when played with one of these on Unknown's Octagon. Sometimes after it is killed, the navigation messes up and it goes straight into a wall.
Also, there is a bug in my shielding code, (inconsistent calls of onTick threw it off), but it will be fixed sometime soon.

EnderBot
<<

watusimoto

Site Admin

Posts: 1558

Joined: Tue Feb 23, 2010 7:07 pm

Location: Quartz's mom's house

Post Fri Mar 12, 2010 5:31 pm

Re: EnderBot

I created a bitfighter subdomain on pastebin... so you can use that if you want. http://bitfighter.pastebin.com/ The way we use it, it probably doesn't really matter.

Also, I like the way you declare your variables outside of main(). That makes it very clear what's global and what's not. Perhaps we should require that, and not permit globals to be declared in main()...
<<

karamazovapy

Posts: 1567

Joined: Tue Feb 23, 2010 7:52 pm

Post Fri Mar 12, 2010 5:44 pm

Re: EnderBot

Isn't declaring x=nil in Lua essentially not declaring x at all?
<<

watusimoto

Site Admin

Posts: 1558

Joined: Tue Feb 23, 2010 7:07 pm

Location: Quartz's mom's house

Post Fri Mar 12, 2010 6:04 pm

Re: EnderBot

No, declaring x=nil is saying "hey, Lua, I'm creating a variable here, and giving it a value of nil!"

Not declaring a variable looks like this:
<<

karamazovapy

Posts: 1567

Joined: Tue Feb 23, 2010 7:52 pm

Post Fri Mar 12, 2010 6:29 pm

Re: EnderBot

Since all undeclared/unused variables have a default value of nil, I thought declaring x=nil was equivalent to "deleting" x...not the case?
<<

watusimoto

Site Admin

Posts: 1558

Joined: Tue Feb 23, 2010 7:07 pm

Location: Quartz's mom's house

Post Sat Mar 13, 2010 3:06 am

Re: EnderBot

Weeeeeeelllll... maybe. In standard Lua, all variables are global unless declared otherwise, and they can be instantiated anywhere for any reason. This makes it really easy to be sloppy and make mistakes, so I've set things up such that you get an error if you try to declare a global variable anywhere but "loose" in the file, or in the main() function (if you look in one of the Lua helper function files, you can see where this happens, and can even disable it without requiring a recompile). By setting the variable to nil, you are announcing that the variable should hereby be considered declared. In normal Lua... I'm less sure.
<<

watusimoto

Site Admin

Posts: 1558

Joined: Tue Feb 23, 2010 7:07 pm

Location: Quartz's mom's house

Post Sat Mar 13, 2010 3:13 am

Re: EnderBot

These bots are getting better. This one is actually fun to play with.
<<

Unknown

User avatar

Posts: 183

Joined: Mon Mar 08, 2010 4:48 pm

Post Sat Mar 13, 2010 11:56 am

Re: EnderBot

The pathfinding bug is not on my side of the code.
A bug with pathfinding is evident in this bot when played with one of these on Unknown's Octagon. Sometimes after it is killed, the navigation messes up and it goes straight into a wall.
<<

watusimoto

Site Admin

Posts: 1558

Joined: Tue Feb 23, 2010 7:07 pm

Location: Quartz's mom's house

Post Sun Mar 14, 2010 9:49 am

Re: EnderBot

No, it's not. It's fixed in the latest version (unless you go through a teleporter, in which case you'll need to manually "reset" the nav system by asking for waypoint to random location).

Return to Bots

Who is online

Users browsing this forum: No registered users and 2 guests