Choplifter V1.1.1


(Scott R) #21

Surely if someone has an issue pressing two directional buttons at the same time on their clone they need to be reviewing their own design and adjusting it to meet their personal needs?
And of the 150 1st Edition and 250 2nd Edition Develoment kits produced, I would expect the majority of users would be in possession of the two-three fingers needed to play the game. Whilst it can be a little awkward at first it’s really not that hard once you’re used to it.


It’s even almost playable playing with one hand whilst filming with the other.


Playing some more I noticed you can’t crash into the objects so this is perfect in its current state for anyone with button pressing issues.


@filmote I just noticed that I also somehow managed to pick up a random group of passengers that stopped me collecting the second lot of hostages in this video?

Edit:
It looks like I picked them up by flying into the second building.

Edit 4 or 5 or something:

Yep you can collect all the hostages by landing at an unopened building.


(Simon) #22

I don’t think I will be doing that.

As @Keyboard_Camper says above, if someone has built a frankenstein of a clone using buttons salvaged from one cold war equipment and has managed to install them six inches apart thus preventing them from using one finger to press two buttons, then they probably are having problems with any action game on the Arduboy.


(Simon) #23

I have just committed version 1.0.3 to the repo. It fixes a few little issues and requires you to use your toes for shooting.

Do you mean you flew through the building and this allowed you to pick them up? Did the building ‘open’ as a result of your flying through? A tank can open a building too.

Edit: Oh I see what you mean. That shouldn’t happen! I have fixed that too, now. Thanks for the heads-up.


(Scott R) #24

I can land at a closed building and get +16 passengers without them exiting


(Simon) #25

Version 1.0.3 has just been checked in … it fixes this issue amongst others.

That little bug makes it a little easy!

Edit: Also, as of the latest commit it now has some introduction - music ‘Ride of the Valkyries’ as per Apocalypse Now.


(Pharap) #26

It depends on the algorithm being used.
I find a lot of the time rand implementations rely on a Linear Congruential Generator which has been proven to have bias.

Throw in modulo bias and results can often have noticable trends (like travelling to the left).

I don’t know if that’s the issue here, but it’s worth considering.


(Simon) #27

It could just be shit code on my behalf. Will need to look at that. If nothing else, I should prevent them wandering off to the edge of the world (as we all know that is way out to the left).


(Felipe Manga) #28

Wild guess: you wouldn’t happen to be doing a divide/multiply and then flooring instead of rounding, would you?


(Simon) #29

No … from memory, a simple random().


(Felipe Manga) #30

I sure hope random isn’t just an LCG like @Pharap mentioned earlier, it takes up way too much space for that kind of algorithm.


(Pharap) #31

If I knew the exact line I could take a look.

I notice you’re using random(n, m) a lot, which could mean there’s modulo bias involved because that uses modulo.

(See WMath.cpp.)

If you’ve never encountered modulo bias, I find this SO answer is quite a good explanation.

I can’t find the random implementation on the github code. I’m guessing the implementation varies between chip, so I’ll have a dig around my local files for a better clue.

Not sure what you mean by ‘too much space’ though, LCG state only needs one variable (most likely 32 bit given that random returns a long), the modulus, the multiplier and the increment are all constant values.


(Felipe Manga) #32

I didn’t mean the state, I mean the code takes up a lot of flash space. I had to go through its disassembly looking for a bug and vaguely recall having seen much smaller implementations.


(Felipe Manga) #33

Back to the subject of Choplifter… I’m not sure if this is a bug or not, but I was doing a test with the build that’s in the repo. I simply started the game, didn’t take off, and after a while I got 16 hearts. Is that supposed to happen?


(Simon) #34

Errr … no. I wonder how that happened?

How long did it take? I wonder if the hostages walked off the left hand side of the world, overflowed, and reappeared on the right (which would automatically take them to the base)?

Edit: I have been sitting at base now for 5 minutes and it did not happen to me.


(Felipe Manga) #35

I didn’t time it… I just left it there and took the dog for a walk. :stuck_out_tongue:
Maybe 20 minutes?


(Simon) #36

Oh, then my theory has some weight. They must have walked a long, long way as the x-pos for these players is a 16 bit integer. I wonder what Galileo would have thought about that - proves the earth is round even in Arduboy land.


(Simon) #37

It happened to me as well!

OK, so I will need to put a fix in to stop the hostages roaming the earth.


(Pharap) #38

Or at least stop them going too far left.


(Simon) #39

The fence stops them going right. Maybe I should put a fence on both sides?


(Pharap) #40

Sounds easier than the solution I was going to suggest.