Forums

Topic: Petit Computer

Posts 6,521 to 6,540 of 9,620

Slayer

Well, I gotta hunt that wolf and be done with it. (MMZ2)
Petit Computer time. I understand basic variable stuff now, as in text, I just need to know the point of it.

Edited on by Slayer

I have nothing really to say about myself.

Pixelrobin

So I have a program that resets the entire graphic screen every loop. It has to do that. But, its a bit "Flasy" when you overload it. Is there a smoother way of doing this (Possibly with GCOPY).

BTW, i Mispel things all the tim. But yuo cane stil read this. No ned to be gramer cops.

Everybody do a chirp. CHIRP.

3DS Friend Code: 3007-9228-5126

ChangeV

Morphtorok wrote:

Thank you!

Lol at the nomination selection process.

Also if you don't mind... What are the stickers about? I can figure out the obvious ones (characters, dsiware icon, petit developer, etc) but some are kinda unknown to me!

here is sticker translation
each section is divided with ~~~~~~~~~~

~~~~~~~~~~
Good for nothing in your life! SmileBoom funny sticker
~~~~~~~~~~
puchicon mkII
PETITCOMPUTER
MARK2
~~~~~~~~~~
SmileBoom
Petit
Developer
~~~~~~~~~~
hakase
(Professor Jones)
~~~~~~~~~~
wanpaku-kun
(Johnny)
~~~~~~~~~~
intelli-kun
(Nigel)
~~~~~~~~~~
kanzaki
(Billy)
~~~~~~~~~~
detective uncovers!
Smile boom
Survey report
~~~~~~~~~~
John Brister's
those days,
8 bit machine and
~~~~~~~~~~
by Anonymous/unspecified large number of people
internal affairs exposure diary
~~~~~~~~~~
SmileBoom
The announcement
~~~~~~~~~~
Sugiura's
(wai-) I don't know much in detail
~from Shuffle replay list~
~~~~~~~~~~
Lord Frederick's
Applause radio
800 MHz

ChangeV

randomous

Hey, I was wondering if anybody has a good solution (or an opinion on my solution) to this problem I'm having. I have an array which will store the position, velocity, and acceleration of each object on the screen. However, sometimes an item needs to be removed from it, and sometimes an item will be added. It would be lovely if I had a linked list... but sadly I do not. In Village, I got around this by just making a static array with a special field for "spawned", and I'd just iterate over the whole array and skip the ones that weren't spawned. This works fine when you don't have too much stuff in the array, but this time, the objects are going to be coming and going at an alarming rate, and there could be quite a lot of them. Thus, searching through the entire array to find an open spot isn't going to work... so I need another solution.

The solution I came up with was to use a string to represent which slots were currently open and which were not. It would start out as a string filled with 0's or something. I could then use INSTR to get the first occurrence of a 0, and that position would be the first free position in the array of velocities/etc. I'd then set it to 1. This sort of solves the "linear search" problem, as I've replaced an interpreted linear search with a "native" one.

I know there's a better way to this... but I just can't think of it. Do you guys have any suggestions?

Edit: Dang, I thought I could do this with binary... but there's no "log base 2" function (which I could have used to find the last 0 or 1 bit in a number), and doing "log(A)/log(base)" doesn't give exact results.

Edited on by randomous

randomous

Pixelrobin

@randomous if why not use SPSETV and SPGETV() for sprite objects? I always find those more useful than a DATA table for each sprite.

Everybody do a chirp. CHIRP.

3DS Friend Code: 3007-9228-5126

randomous

@Bluerobin2 I could store the data in the sprite itself, sure. But that doesn't solve the problem of finding the first available slot... now I have to find the first available sprite.

randomous

iprice

Can you not iterate through the array elements with a simple FOR/NEXT loop and if there's a space use the SWAP command with the next available array element? That way when you add a new element, just add it to the bottom of the stack.

Basically bubble sorting your array.

I code, therefore I am.

randomous

@iprice But that's even slower than just filling in the first available slot... remember, I'm trying to come up with a solution such that no matter how big the array is, it takes the same amount of time to find an empty slot.

After testing INSTR/SUBSTR, I've concluded that it's more than fast enough to do whatever I need. Here's an example: it took 13 frames to find an empty slot in a simulation 100 times, and only 1 for INSTR/SUBSTR with the same simulation (100 times). With a different simulation, linear insertion find&insert took 300 frames.... INSTR/SUBSTR took 3. I think it wins lol.

Edited on by randomous

randomous

iprice

I've not used INSTR in PTC before, but it looks like you've found your answer.

I code, therefore I am.

randomous

@iprice But it's such a messy solution. I'm still looking for another way, if anybody's got one.

randomous

calc84maniac

randomous wrote:

@iprice But it's such a messy solution. I'm still looking for another way, if anybody's got one.

Another approach you can take is to keep track of the total number of sprites, which I'll call N, and only use sprite slots 0 to N-1. Then, whenever you remove a sprite, let's say from slot M, you can move sprite N-1 to slot M and decrease N by 1.

calc84maniac

InsertPi

@BonChoi hasn't been on in a while...

@mystman12 example? Cause if I'm thinking correctly, you can just do

X$="θ"

Edited on by InsertPi

If Facebook, Myspace, Twitter, Instagram, and Snapchat were all destroyed, 90% of teens would go insane. If you're one of the 10% that would be laughing at them, copy & paste this into your signature and hope it happens.

3DS Friend Code: 2148-9259-0831 | Nintendo Network ID: IAmAPerson620 | Twitter:

randomous

@calc84maniac Pfft, of course! Goodness, it's always the simple solutions that work the best, isn't it? Thank you.

randomous

calc84maniac

randomous wrote:

@calc84maniac Pfft, of course! Goodness, it's always the simple solutions that work the best, isn't it? Thank you.

Yeah, the real trick is that you don't care about what order things are in. If order mattered, it would be a bit more complicated.

calc84maniac

InsertPi

Minecraft DS Beta 1.5.5 will have a fully working inventory! You'll even be able to control what blocks go where in your hotbar! For example, if I wanted TNT in slot 1 on my hotbar, and sand on slot 2, we can now do that! I'll add render distance and the release it! Also, if you have bedrock hacked onto your map, unless you want it to stay, I suggest you move it, cause bedrock is now unbreakable (and unobtainable, but it's easy to hack into your inventory)

If Facebook, Myspace, Twitter, Instagram, and Snapchat were all destroyed, 90% of teens would go insane. If you're one of the 10% that would be laughing at them, copy & paste this into your signature and hope it happens.

3DS Friend Code: 2148-9259-0831 | Nintendo Network ID: IAmAPerson620 | Twitter:

LeviCelJir

IAmAPerson wrote:

Minecraft DS Beta 1.5.5 will have a fully working inventory! You'll even be able to control what blocks go where in your hotbar! For example, if I wanted TNT in slot 1 on my hotbar, and sand on slot 2, we can now do that! I'll add render distance and the release it! Also, if you have bedrock hacked onto your map, unless you want it to stay, I suggest you move it, cause bedrock is now unbreakable (and unobtainable, but it's easy to hack into your inventory)

Can't we just MCDSedit it out

Hi I'm Levi and I like Bloopys :^)

TAINT_Zzyex

http://petitcomputer.wikia.com/wiki/RPG_Sprites FINAL edition of my rpg sprites. more will come i guess. these are all that i will have in my first game. (ize got movement in) when i have a battle system i will post

"Did somebody say Aincrad?"
"No, go back to your own game!"
"awwww"
"And make out with Asuna."
"Aww-I mean YAY"

Twitter:

randomous

Hey, what happens to SPHITNO when the our sprite hits multiple sprites? Is there a way to get each sprite that our sprite is colliding with?

Edited on by randomous

randomous

calc84maniac

randomous wrote:

Hey, what happens to SPHITNO when the our sprite hits multiple sprites? Is there a way to get each sprite that our sprite is colliding with?

Yeah, SPHIT takes an optional second argument which is the initial ID of the other sprites to check collision with. So to detect multiple collisions, put SPHITNO+1 in that second argument to search after the first detected collision.

calc84maniac

Please login or sign up to reply to this topic