Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - ZippyDee

Pages: 1 ... 4 5 [6] 7 8 ... 51
76
Other Calc-Related Projects and Ideas / Re: Psuedo mode 7 with lines?
« on: February 22, 2012, 02:42:36 am »
The way you explained that using such casual terms makes it sound like it's all just trivial, obvious calculations. :P Just made me laugh, that's all...

77
TI Z80 / Re: Raycaster from Planet Disco
« on: February 20, 2012, 08:55:35 pm »
yeah, but that's compressed programs, with ununderstable code (what, I'm a newbie ?)
Compressed programs? Neither of the three have any sort of compression going on (that I know of), it's just regular Axe.
Yeah, but I meant without any explication of how it work (bad English powaaa)
The term you're looking for is "optimized," not "compressed." Compression is where a set of data is encoded in such a way that the resulting data is smaller in size than the original data. Optimization is when a program is modified so it runs faster or uses less memory, or otherwise becomes more efficient than before.

78
Humour and Jokes / Re: Funny #omnimaga quotes (NSFW)
« on: February 20, 2012, 02:53:32 am »
Pshh...Taking my words out of context.

79
TI Z80 / Re: TinyCraft [Axe]
« on: February 18, 2012, 03:49:50 pm »
In this game, is there only 1 level or can the player go underground?
Normally there should be a nether, the mines and the air world(or something like that). All of these should be a kind of world. So 4 in total iirc.
three underground worlds, main world, and air world. so five.

80
Computer Projects and Ideas / Re: Fixed-Memory Flood Fill Pseudocode
« on: February 16, 2012, 03:01:25 pm »
only one mark is ever placed at a time. yeah.

81
Computer Projects and Ideas / Re: Fixed-Memory Flood Fill Pseudocode
« on: February 16, 2012, 02:46:37 pm »
If you ever wanted to add grayscale support then you'd need another buffer, meaning 3 buffers...that's a lot of memory to keep track of... The whole point is that this algorithm uses no extra memory other than what is in the routine itself.

82
Axe / Re: Help with Sprite Rotation
« on: February 14, 2012, 12:47:23 am »
I think this is referring to arbitrary rotation, in which case I would advise a search of the forums. There have been a few threads about this fairly recently, actually.

83
Computer Projects and Ideas / Re: Fixed-Memory Flood Fill Pseudocode
« on: February 13, 2012, 07:24:39 pm »
Hmm, so your flood fill algorithm just traces around the edge of the region until it is all filled? Nice...
I am curious, will it work properly if you have a setup like an hourglass but at the middle (where it is narrow) you have 1 empty pixel with a black pixel on either side?

EDIT: Ah, I see the screenies, now >.>

Yeah, the algorithm traces the edges and only fills in a pixel if it is positive that filling that pixel will not block off another area to fill. If it is unsure, it places a markat that "questionable" pixel indicating the direction it was heading and continues to trace the edges until it comes back to the mark.

If it reaches the mark and the mark is pointing in the direction that it was already heading, then it knows filling that pixel will still allow it to get to the other side.

However, if it reaches the mark and the mark is pointing in a different direction, then there must be some sort of a loop that turns it back onto itself, meaning it wouldn't be able to reach the other side if it filled the pixel.

To eliminate this loop, it turns around and starts backtracking around the loop. Once it reaches another "questionable" pixel in that loop, a second mark is placed on that pixel. It keeps backtracking until it runs into one of the two marks.

If it runs into the second mark before the first mark, it knows the place where it gets turned around on itself must be further into the loop, so it turns around and backtracks again, finding the NEXT "questionable" pixel.

But if it reaches the first mark before the second it knows that filling the pixel at the second mark will get rid of the loop without blocking off the rest of the map. So it fills in the pixel at the second mark, removes both marks, and continues as usual from where the second mark was.


Hope that explanation helps clarify how the algorithm works. It's certainly easier than trying to interpret that pseudocode.


Edit:
In those screenshots, the screen is being updated 4-5 times per frame, so the program is spending most of the time updating the screen. Also, I haven't even started optimizing the code, and I have some ideas for how to optimize the algorithm. In fact, filling a blank screen from the center without updating the screen currently takes only 10 seconds (That's 24x faster than the screenshot ;D).

Edit: Updating every 256'th frame looks like this:
What about updating every Xth time it paints, not every Xth frame? That might go even faster.

84
Computer Projects and Ideas / Re: Fixed-Memory Flood Fill Pseudocode
« on: February 13, 2012, 01:15:39 pm »
That looks awesome, jacobly!

You know, if the finished version is still quite slow, it may be good to periodically draw to the screen as it fills rather than only at the end, just so people know it's still working and hasn't totally crashed or something.

How fast is this when it only draws to the screen when it finishes rather than plot every pixel individually?
Well, the algorithm itself is going to be slow. There's no way around that. It has to do a lot of tracing of boundaries in order to validate the pixels for drawing. The only question is about how slow it will be. This floodfill will certainly not be anything you'd want to use for dynamic drawing in games or anything. I'd say it would be used solely in on-calc graphics programs. Yes, it will be slow, but the trade off is worth it to have a floodfill that doesn't threaten a stack overflow no matter how large or complex of a shape you are filling.

85
Art / Re: 6x6 person
« on: February 12, 2012, 10:54:55 pm »

 ##
###
####
 ##
X##
  #



 ##
###
####
 ##
 ##
  #



 ##
###
####
 ##
###
  X


#=black
X=gray

You said you were using 3-level gray, right?

86
Axe / Re: Axe Q&A
« on: February 12, 2012, 06:48:36 pm »
I can't figure out what is going wrong >.< You might want to hop over to the bug reports and see if anybody familiar with the inner workings of the Copy() function can help figure out what is going wrong.
Check the bug reports. Runer just posted the issue.

87
Computer Projects and Ideas / Re: Fixed-Memory Flood Fill Pseudocode
« on: February 10, 2012, 04:07:29 am »
Ah maybe I didn't notice, since it was going on pretty fast.

Also I'm curious how fast this would be in z80 ASM, considering you don't have to update the LCD every frame but only at the end.
Yeah, I'm wondering that, too. Seeing as it's such an obnoxiously slow routine, a mostly-speed-optimized ASM version would probably be best. I personally don't feel like I'd be able to make a very good routine in ASM. I'd rather that someone else give it a go...

Maybe someone could even write an Axe implementation just so something exists to base some of the ASM off of. This pseudocode is written in structured English, so it's not really written for easy translation directly into ASM.

88
Computer Projects and Ideas / Re: Fixed-Memory Flood Fill Pseudocode
« on: February 10, 2012, 04:00:01 am »
Interesting, thanks for the link. I am curious if in some occasions it can loop forever, though? Because once it seemed to go through the same path 5 times until it finally started filling more stuff, and as an ASM program, if it can end up into an endless loop, then that means a battery pull/RAM Clear :P
No, it will not loop forever. Each time it went through the path, it changed something. It either filled at least one pixel, or it moved the marker to a new location.

Hmm, maybe I should rewrite my JavaScript minesweeper to use a better algorithm.
I just made mine form scratch, so its probably not efficient.
For javascript, you shouldn't have to worry about stack or memory issues, so a simple recursive flood-fill would be best. This one is much too slow to be worthwhile for any system that can handle recursive/stack-based flood-fills.

89
Computer Projects and Ideas / Re: Fixed-Memory Flood Fill Pseudocode
« on: February 10, 2012, 03:48:55 am »
To be consistent, each case in the main loop should probably end with continue main loop. Also, I don't see any code that sets MARK2.
Oops! I accidentally put MARK instead of MARK2 at the place it should be set. Fixed that now. And I added the "continue main loop" as well.

90
Computer Projects and Ideas / Re: Fixed-Memory Flood Fill Pseudocode
« on: February 10, 2012, 03:45:22 am »
Here's a link to the flash file I made to debug this algorithm.

http://megaswf.com/file/2130949

The red arrow is the curent location, the blue filled arrow is the first marker, and the blue filed arrow with a green outline is the second marker used for removing unwanted loops.

Pages: 1 ... 4 5 [6] 7 8 ... 51