FAQ  •  Register  •  Login

EnderBotV3

<<

Unknown

User avatar

Posts: 183

Joined: Mon Mar 08, 2010 4:48 pm

Post Tue Mar 23, 2010 9:12 pm

EnderBotV3

EnderBotV3
Requires NavMesh and newest version of Bitfighter WITH Point class fixes.
PS. Wat, why do my bots seem to jump when I run a lot of them at a time? The game itself runs smoothly, but the bots are taking moves one at a time it looks like.

Passing in arguments is required and is as follows:
Robot <team> EnderBotV3.lua <skill> <agressiveness> <offense/defense> <top speed> <directionThreshold>

My implementation:
Robot 0 EnderBot.lua .75 .75 0 1 .25
This is a pretty good offensive bot.
Last edited by Unknown on Wed May 26, 2010 9:19 am, edited 1 time in total.
<<

watusimoto

Site Admin

Posts: 1558

Joined: Tue Feb 23, 2010 7:07 pm

Location: Quartz's mom's house

Post Mon Mar 29, 2010 10:58 am

Re: EnderBotV3

While I was away, I lost track of which version of BF is which! If you are using one that requires Lua to create point objects to do point computations (which you probably are), then the problem is likely due to memory management issues. That is, Lua has to create lots and lots of objects to do the calculations you are asking for, and, with lots of bots and lots of frames, there's a lot of memory allocation, deallocation, and garbage collection going on behind the scenes.

I haven't yet tried your latest bot (but I will just as soon as I can get my development environment back), but it sounds like issues I've seen before and I think that was the cause.

The fix, which is mostly implemented but not yet tested, sitting on the drive of my now broken laptop, dispenses with this by letting you have direct access to the C++ point structs that the game uses to track object position/velocity internally. You should be able to do most of your calculations without creating any new Lua objects as intermediates, and that should make everything run much smoother. Of course, you will not have write access to this data, but you generally don't need it. And, as a bonus, it will look almost exactly the way it does now from the Lua side.

I've had this idea for over a week, and I am really eager to test it out. I'll probably port your bot over as a test. Just as soon as my laptop woes have been dispensed with, that is.
<<

Unknown

User avatar

Posts: 183

Joined: Mon Mar 08, 2010 4:48 pm

Post Mon Mar 29, 2010 12:41 pm

Re: EnderBotV3

The version I was using uses the Lua point structure found in lua_helper_functions.lua. It had some bugs which I fixed and posted on the other section of the forums.
<<

watusimoto

Site Admin

Posts: 1558

Joined: Tue Feb 23, 2010 7:07 pm

Location: Quartz's mom's house

Post Fri Apr 02, 2010 10:36 am

Re: EnderBotV3

Not totally idle without my machine. I found this, which, I hope will make the vector math go much faster:

http://code.google.com/p/lua-vec/

In brief, it is a modification of the base Lua interpreter that will make vectors act like other simple data types (e.g. numbers) so that they will not require garbage collection and memory allocation. In their benchmarks, they showed over 4x improvement in speed using these mods over the techniques used in recent BF releases. I've requested the author provide further optimizations for 2D vectors (like what we use), and, I think, he has agreed.

So... soon, I hope, I'll be incorporating this into the existing BF code and will get a new release out with EnderBotv3 ported as a test.
<<

Unknown

User avatar

Posts: 183

Joined: Mon Mar 08, 2010 4:48 pm

Post Fri Apr 02, 2010 1:34 pm

Re: EnderBotV3

Sweet. Looking forward to it.
<<

watusimoto

Site Admin

Posts: 1558

Joined: Tue Feb 23, 2010 7:07 pm

Location: Quartz's mom's house

Post Mon Apr 05, 2010 2:04 am

Re: EnderBotV3

It's going to be good. I've got a mostly working system going now, and I incorporated the lua-vec stuff, and ported the EnderBotV3 to it, and it's the best performance yet. I need to look into how to make it a tad more object oriented, but we can probably live without that in the final analysis.

I'll try to get a compiled sample out in the next few days.
<<

moocow

Posts: 13

Joined: Thu May 13, 2010 2:22 pm

Post Thu May 13, 2010 2:25 pm

Re: EnderBotV3

I'm sorry i havent played in awhile but the code on the website that you gave the link to thats the bot file right? Could you post a sample level that already has the bot stuff in it? thanks

Also i go to a laptop school. Recently i showed my friends bitfighter. Good news guys! WE got about 25 new people! noobies
<<

watusimoto

Site Admin

Posts: 1558

Joined: Tue Feb 23, 2010 7:07 pm

Location: Quartz's mom's house

Post Thu May 13, 2010 4:27 pm

Re: EnderBotV3

In the wiki there is a sample level that shows how you add bots.
<<

moocow

Posts: 13

Joined: Thu May 13, 2010 2:22 pm

Post Thu May 13, 2010 6:08 pm

Re: EnderBotV3

then what is NavMesh? these bots will only work on the pre release of 013 right?
<<

watusimoto

Site Admin

Posts: 1558

Joined: Tue Feb 23, 2010 7:07 pm

Location: Quartz's mom's house

Post Sat May 15, 2010 2:12 am

Re: EnderBotV3

Ah yes... the navmeshzone. These are what help the bots navigate a level. They're kind of a pain to create at the moment, but I'm developing a set of tools to make it much easier.

Somewhere in this forum is a level called Octagon that comes complete with a set of navmeshzones; I'd suggest starting with that because creating the zones with the current tools is a PITA.
<<

moocow

Posts: 13

Joined: Thu May 13, 2010 2:22 pm

Post Mon May 17, 2010 2:05 pm

Re: EnderBotV3

I got a copy of Unknown's level Octagon and then copied the quickbot file that he gave in the post to my bot folder. (it is in a BOT file) I edited the level file from
CTFGameType 8 20
LevelName Unknown's Octagon

to this

CTFGameType 8 20
Robot 1 quickbot.bot
LevelName Unknown's Octagon
LevelDescription Part of Unknown's Level PackageI

then opened bitfighter 012 (most recent) opened up the level editor, typed in the level name. It showed me the level, then i went to test it. Everything worked fine except i couldnt even find the bots.
I then tested orbitbot.bot to see if that would work. It did. did i enter the bot type on the level wrong? I used the quickbot code from this http://pastebin.com/cWnnadYz
Is that the right one? Thanks
<<

watusimoto

Site Admin

Posts: 1558

Joined: Tue Feb 23, 2010 7:07 pm

Location: Quartz's mom's house

Post Mon May 17, 2010 3:03 pm

Re: EnderBotV3

I think you'll need a 013 pre-release for Unknown's bot to work.
<<

Unknown

User avatar

Posts: 183

Joined: Mon Mar 08, 2010 4:48 pm

Post Mon May 17, 2010 3:11 pm

Re: EnderBotV3

013 is required for my bot AND the robot line on the code must be below the team definition.
<<

moocow

Posts: 13

Joined: Thu May 13, 2010 2:22 pm

Post Tue May 18, 2010 2:43 pm

Re: EnderBotV3

Okay i did all that you said and i get this message when trying to run the level.
"Couldn't find class rep for dynamic class: NavMeshZones"
<<

watusimoto

Site Admin

Posts: 1558

Joined: Tue Feb 23, 2010 7:07 pm

Location: Quartz's mom's house

Post Tue May 18, 2010 11:07 pm

Re: EnderBotV3

Edit the level file and replace every instance of

NavMeshZone

with

BotNavMeshZone
<<

Unknown

User avatar

Posts: 183

Joined: Mon Mar 08, 2010 4:48 pm

Post Wed May 19, 2010 1:56 pm

Re: EnderBotV3

I'll fix the map in the Map Gallery.
<<

moocow

Posts: 13

Joined: Thu May 13, 2010 2:22 pm

Post Thu May 20, 2010 1:03 pm

Re: EnderBotV3

thanks. quickbots and orbitbots work but enderbots do not. it just crashes when i put more than two in the map and when i only put one it shows enderbot when i press tab but i cant even find the bot
<<

Unknown

User avatar

Posts: 183

Joined: Mon Mar 08, 2010 4:48 pm

Post Thu May 20, 2010 3:18 pm

Re: EnderBotV3

I dunno. It works for me. I had 6 running at once just fine.
<<

watusimoto

Site Admin

Posts: 1558

Joined: Tue Feb 23, 2010 7:07 pm

Location: Quartz's mom's house

Post Thu May 20, 2010 10:31 pm

Re: EnderBotV3

Can you provide any additional info about the crashes? Error messages, logfile entries, etc. could be helpful.
<<

moocow

Posts: 13

Joined: Thu May 13, 2010 2:22 pm

Post Wed May 26, 2010 8:31 am

Re: EnderBotV3

Okay heres the problem. I had a quickbot on both teams. When i only left it on team 1 (red) it was fine but when there was one on team 2 (blue) it crashed. I added multiple enderbots this time. No crash but I cant find the bots. It doesnt even say enderbot when I press tab

EDIT:
woah okay this is different. I tried adding an enderbot to team 2 and it crashed so i took it off. THen i added one to team 0. When i tested the level it shows all enderbots when i press tab but i still cant find them (see level code below and picture atached)

THE BEGINNING OF THE LEVEL
CTFGameType 8 20
LevelName Unknown's Octagon
LevelDescription Part of Unknown's Level Package
LevelCredits Unknown
GridSize 300
MinPlayers 1
MaxPlayers 18
Team Blue 0 0 1
Team Red 1 0 0
Robot 1 enderbot.bot
Robot 1 enderbot.bot
Robot 1 enderbot.bot
Robot 0 enderbot.bot
BotNavMeshZone 3.1 3.6 3.9 3.6 3.9 8.9 3.1 8.9


EDIT: o something else now. When i add a quickbot on either team 0 or 1 all of the enderbots no longer show when i press tab. In addition, in both games i played the turret for the other team was not shooting at me... Interesting
You do not have the required permissions to view the files attached to this post.
<<

watusimoto

Site Admin

Posts: 1558

Joined: Tue Feb 23, 2010 7:07 pm

Location: Quartz's mom's house

Post Wed May 26, 2010 9:33 am

Re: EnderBotV3

If the bots are showing up in the <TAB> list, they've got to be there somewhere! BTW, you have two teams; the first one listed is team 0, the second is team 1. The level listing you provided looks right, but I'm now confused on what exactly the problem is as your message contained many revisions and updates.
<<

moocow

Posts: 13

Joined: Thu May 13, 2010 2:22 pm

Post Wed May 26, 2010 9:44 am

Re: EnderBotV3

Basically the problem is i cant find the enderbots. I added one to my team. Then i hit c to show the whole map. If a bot was on my time I would see it and a square around it right? Well when i hit c there were no bots on my team but when i hit tab there is a bot on my team.
<<

watusimoto

Site Admin

Posts: 1558

Joined: Tue Feb 23, 2010 7:07 pm

Location: Quartz's mom's house

Post Thu May 27, 2010 1:40 pm

Re: EnderBotV3

Indeed that is puzzling. Not only should you be able to see the bot because he's on your team, but you can currently see all bots anywhere on the map, regardless which team they are on.

So I can't explain what you are observing. However, if the bot crashes and dies for some reason, I am reasonably confident that it would be removed from the <tab> display.

I am almost done with the work I want to do to the editor for 013, so I can look into this more soon.
<<

ZoombeR

Posts: 1036

Joined: Fri Jun 04, 2010 11:56 pm

Post Sat Jun 26, 2010 3:03 pm

Re: EnderBotV3

watusimoto wrote:Indeed that is puzzling. Not only should you be able to see the bot because he's on your team, but you can currently see all bots anywhere on the map, regardless which team they are on.

So I can't explain what you are observing. However, if the bot crashes and dies for some reason, I am reasonably confident that it would be removed from the <tab> display.

I am almost done with the work I want to do to the editor for 013, so I can look into this more soon.


Sorry for the late post, but i have experienced this as well. Ive checked the console and my map did indeed delete bots, but they still showed up on the tab list.
Also, if i killed the bots quick enough, they wouldn't re-spawn and still show up on the tab list

Return to Bots

Who is online

Users browsing this forum: No registered users and 6 guests