Difference between revisions of "User talk:Awesomeness"

From Robowiki
Jump to navigation Jump to search
m
(American flag)
 
(52 intermediate revisions by 7 users not shown)
Line 2: Line 2:
 
| title = Archived talks
 
| title = Archived talks
 
| page1 = Archived Talk 20090502
 
| page1 = Archived Talk 20090502
 +
| page2 = Archived Talk 20090504
 
}}
 
}}
  
Okay, I need to make a list of bullets.  I have made a bullet class and everything, but I need a special list that will let me access all of the bullets in a while/for loop and be able to add and remove them at any time and never mess up.  If I did this in a normal array I could do a for loop and access using an increasing number, but I wouldn't know when to stop. In a while loop, if I used while(bulletsArray[x] != null) and then increment x, after I remove my first bullet that say, hit a wall, it will stop there.  I need help!
+
Help! I can't edit any pages because of some stupid database error! --[[User:Awesomeness|Awesomeness]] 21:57, 6 May 2009 (UTC)
  
:Thanks,
+
:Hey, it works now...  --[[User:Awesomeness|Awesomeness]] 22:00, 6 May 2009 (UTC)
::[[User:Awesomeness|Awesomeness]] 14:02, 2 May 2009 (UTC)
 
  
I think this will do:
+
Okay, I'm almost done with the prototype of my bot. It's really big, so I'll put it [[PwnBot/Current_Code|here]]. I'm sure it has lots of problems with the antigrav movement, (just look at the console, which shows the x force and y force that the points generate) and I'm sure it doesn't work at all... However, do take a look at the debug graphics, I think they're cool. =)
<pre>
+
--[[User:Awesomeness|Awesomeness]] 20:52, 4 May 2009 (UTC)
ArrayList<Bullet> bullets = new ArrayList<Bullet>();
 
for (int i = 0; i < bullets.size(); i++) {
 
    Bullet bullet = bullets.get(i);
 
    if (bullet.needRemove()) {
 
        // I think this will work
 
        // bullets.remove(i--);
 
        // but usually I do
 
        bullets.remove(bullet);
 
        i--;
 
    }
 
}
 
</pre>
 
Here I assume that you use ArrayList to store you bullets and your bullet's classname is Bullet. If you use a plain array to keep the bullets, consider change to ArrayList. It is more flexible. &raquo; <span style="font-size:0.9em;color:darkgreen;">[[User:Nat|Nat]] | [[User_talk:Nat|Talk]]</span> &raquo; 14:09, 2 May 2009 (UTC)
 
  
:Oh my goshYou're rightArrayList is way more flexible! I looked at the documentation; you don't even have to increment or decrement anything!  The function remove() shifts the other elements to the left already!  Thanks!  [[User:Awesomeness|Awesomeness]] 14:14, 2 May 2009 (UTC)
+
:OH NOSomething I did with the antigrav code messed up the bullet sim codeGood thing I backed up the non-broken version before I added antigrav.  Should I show that one instead? I can't figure out how to add antigrav, I guess I'm simply just not good enough.  Oh well... =(   --[[User:Awesomeness|Awesomeness]] 20:58, 4 May 2009 (UTC)
  
:: Be sure don't use for-each style (<code>for(Bullet bullet : bullets)</code> or you will get ConcurentModificationException when you remove element (this is per java spec, but I still use the for-each style and didn't get this exception actually). And when you scroll through the array like one I mentioned, be sure you do i--, or you will just skip one element. &raquo; <span style="font-size:0.9em;color:darkgreen;">[[User:Nat|Nat]] | [[User_talk:Nat|Talk]]</span> &raquo; 14:19, 2 May 2009 (UTC)
+
:: Don't say that - you wouldn't believe how buggy the first version of [[Dookious]] was. =) And I had been programming for years, and had four semesters of Computer Science study under my belt. Seriously, keep at it, dude... --[[User:Voidious|Voidious]] 21:04, 4 May 2009 (UTC)
  
:: Oh, you're right.  [[User:Awesomeness|Awesomeness]] 14:27, 2 May 2009 (UTC)
+
::: I'm going to put the before-I-messed-it-up code on instead.  --[[User:Awesomeness|Awesomeness]] 22:11, 4 May 2009 (UTC)
 +
 
 +
What do you think of my targeting idea on my userpage? --[[User:Awesomeness|Awesomeness]] 00:44, 7 May 2009 (UTC)
 +
 
 +
: I think I've seen something like this before but I don't remember which so don't care. Now, I understand how I recorded thing to tree, but how it find the match? &raquo; <span style="font-size:0.9em;color:darkgreen;">[[User:Nat|Nat]] | [[User_talk:Nat|Talk]]</span> &raquo; 01:19, 7 May 2009 (UTC)
 +
 
 +
:: It would look through every branch in the tree, and it will look for matches.  It simply takes the current speed, acceleration, turn rate, etc. and finds the closest match, or matches.  If there are multiple branches that match, it would take the branch that occurs most.  I suppose if they're even in occurence it might pick them randomly.  Then again, it might balance out, choosing based on the closeness of the match and the number of occurences combined.  There's lot's of ways to do it.  --[[User:Awesomeness|Awesomeness]] 01:50, 7 May 2009 (UTC)
 +
 
 +
::: OK, I think I remember which now. [[LambdaBot]]'s state searching. =P &raquo; <span style="font-size:0.9em;color:darkgreen;">[[User:Nat|Nat]] | [[User_talk:Nat|Talk]]</span> &raquo; 01:55, 7 May 2009 (UTC)
 +
 
 +
:::: It seems none of my ideas are ever new.  Man!  Everyone's thought of everything!  Either way, I suppose mine might still be new because i'ts a targeting implementation, not movement.  --[[User:Awesomeness|Awesomeness]] 01:58, 7 May 2009 (UTC)
 +
 
 +
:::::  If I'd thought of it just a bit earlier, it'd finally be my first original idea...  --[[User:Awesomeness|Awesomeness]] 02:02, 7 May 2009 (UTC)
 +
 
 +
:::::: Hey, usually we all share many of common ideas, but who can conclude every single step with detailed information will be the inventor =D ABC might be the inventor of Wave Surfing, but many bots have done similar to Wave Surfing, but ABC can conclude what to done before another people. Pual might be inventor of GuessFactor Targeting but David have done thing similar to in the same time. &raquo; <span style="font-size:0.9em;color:darkgreen;">[[User:Nat|Nat]] | [[User_talk:Nat|Talk]]</span> &raquo; 02:09, 7 May 2009 (UTC)
 +
 
 +
::::::: Yeah, I suppose you're right.  I'm going to try to make the gun eventually.  It'll be pretty hard.  --[[User:Awesomeness|Awesomeness]] 02:13, 7 May 2009 (UTC)
 +
 
 +
::::: Just creating a new bot is inventing.  There are always new takes on old ideas, ways to tweak something that's been done and make it better.  What flag do you want in the rumble?  --[[User:Darkcanuck|Darkcanuck]] 02:23, 7 May 2009 (UTC)
 +
 
 +
:::::: American, please.  --[[User:Awesomeness|Awesomeness]] 17:13, 10 May 2009 (UTC)
 +
 
 +
Wow, thanks for clearing it! &raquo; <span style="font-size:0.9em;color:darkgreen;">[[User:Nat|Nat]] | [[User_talk:Nat|Talk]]</span> &raquo; 08:21, 10 May 2009 (UTC)

Latest revision as of 18:13, 10 May 2009

Archived talks:
Archived Talk 20090502 - Archived Talk 20090504

Help! I can't edit any pages because of some stupid database error! --Awesomeness 21:57, 6 May 2009 (UTC)

Hey, it works now... --Awesomeness 22:00, 6 May 2009 (UTC)

Okay, I'm almost done with the prototype of my bot. It's really big, so I'll put it here. I'm sure it has lots of problems with the antigrav movement, (just look at the console, which shows the x force and y force that the points generate) and I'm sure it doesn't work at all... However, do take a look at the debug graphics, I think they're cool. =) --Awesomeness 20:52, 4 May 2009 (UTC)

OH NO! Something I did with the antigrav code messed up the bullet sim code! Good thing I backed up the non-broken version before I added antigrav. Should I show that one instead? I can't figure out how to add antigrav, I guess I'm simply just not good enough. Oh well... =( --Awesomeness 20:58, 4 May 2009 (UTC)
Don't say that - you wouldn't believe how buggy the first version of Dookious was. =) And I had been programming for years, and had four semesters of Computer Science study under my belt. Seriously, keep at it, dude... --Voidious 21:04, 4 May 2009 (UTC)
I'm going to put the before-I-messed-it-up code on instead. --Awesomeness 22:11, 4 May 2009 (UTC)

What do you think of my targeting idea on my userpage? --Awesomeness 00:44, 7 May 2009 (UTC)

I think I've seen something like this before but I don't remember which so don't care. Now, I understand how I recorded thing to tree, but how it find the match? » Nat | Talk » 01:19, 7 May 2009 (UTC)
It would look through every branch in the tree, and it will look for matches. It simply takes the current speed, acceleration, turn rate, etc. and finds the closest match, or matches. If there are multiple branches that match, it would take the branch that occurs most. I suppose if they're even in occurence it might pick them randomly. Then again, it might balance out, choosing based on the closeness of the match and the number of occurences combined. There's lot's of ways to do it. --Awesomeness 01:50, 7 May 2009 (UTC)
OK, I think I remember which now. LambdaBot's state searching. =P » Nat | Talk » 01:55, 7 May 2009 (UTC)
It seems none of my ideas are ever new. Man! Everyone's thought of everything! Either way, I suppose mine might still be new because i'ts a targeting implementation, not movement. --Awesomeness 01:58, 7 May 2009 (UTC)
If I'd thought of it just a bit earlier, it'd finally be my first original idea... --Awesomeness 02:02, 7 May 2009 (UTC)
Hey, usually we all share many of common ideas, but who can conclude every single step with detailed information will be the inventor =D ABC might be the inventor of Wave Surfing, but many bots have done similar to Wave Surfing, but ABC can conclude what to done before another people. Pual might be inventor of GuessFactor Targeting but David have done thing similar to in the same time. » Nat | Talk » 02:09, 7 May 2009 (UTC)
Yeah, I suppose you're right. I'm going to try to make the gun eventually. It'll be pretty hard. --Awesomeness 02:13, 7 May 2009 (UTC)
Just creating a new bot is inventing. There are always new takes on old ideas, ways to tweak something that's been done and make it better. What flag do you want in the rumble? --Darkcanuck 02:23, 7 May 2009 (UTC)
American, please. --Awesomeness 17:13, 10 May 2009 (UTC)

Wow, thanks for clearing it! » Nat | Talk » 08:21, 10 May 2009 (UTC)