• Axe Parser 5 1
Currently:  

Author Topic: Axe Parser  (Read 552212 times)

0 Members and 8 Guests are viewing this topic.

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Axe Parser
« Reply #600 on: May 16, 2010, 08:26:44 am »
definitely a very useful optimization. would evaluating the results of calculations with constants at compile time also be practical? it may make source code easier to read, since one can tell where the numbers came from.
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Axe Parser
« Reply #601 on: May 16, 2010, 04:08:24 pm »
Yay! This optimization makes me happy :)

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Axe Parser
« Reply #602 on: May 16, 2010, 05:27:30 pm »
Yay, I like this optimization!  Great job Quigibo! ;D

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Axe Parser
« Reply #603 on: May 16, 2010, 06:16:50 pm »
Awesome!

I downloaded the update this morning but I had to go to work early so I couldn't post.

I will try to see if my tunnel game optimizes more with this new version. I hope I don't need to change too much code, tho XD (besides getting the gs at 6 MHz)

It was alerady an awesome project, now I am running out of words to describe it :P

EDIT: Aw, no optimizations found in my tunnel, still same size D:, oh well, awesomes still ^^

Also I'm glad we can now display buffers from a pointed memory location :D
« Last Edit: May 16, 2010, 06:26:12 pm by DJ Omnimaga »

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Axe Parser
« Reply #604 on: May 17, 2010, 02:40:50 am »
Amazing work, Quigibo. That was a impressive optimization.  ;)
Is there any main optimizations like that left? ;D

There are many more left.  I only did the most basic of basic look-ahead parsing technique.  Another major optimization will be looking ahead to see if arguments are constant or variable expressions when compiling.  Right now, expressions after each argument are saved as a precaution becasue later arguments might use longer routines that scramble the registers.  But if I can guarantee that all arguments after that point are constant, then I don't need to do all that useless saving.

@DJ, your code probably was optimized.  I had to make the sprite drawing routines slightly larger to accommodate grayscale, however at the same time, there were a couple places that got optimized so it just happened to balance out coincidentally.  ;)
« Last Edit: May 17, 2010, 02:41:41 am by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Axe Parser
« Reply #605 on: May 17, 2010, 12:57:24 pm »
Aaaah I see lol that's probably why :D

I really looked a lot at optimizations initially when doing my first Axe game. For the 2nd one (Netham45) I didn't because I wanted to make sure the final size was exactly 666 bytes :P

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Parser
« Reply #606 on: May 17, 2010, 04:59:07 pm »
I've been working on the start of a game since yesterday. The first task I undertook was animation of the character you control, as I wanted to get to test out the new 4-level grayscale. The 16x16 sprite has 5 different body positions, with the body outlined in dark gray and filled with light gray, as I plan for the surroundings to be drawn in black and white for contrast. It looks great when he isn't moving much, but when he jumps, the image of him breaks up a lot. When drawn in just 3-level grayscale, it looks much cleaner. Is this just an unavoidable aspect of 4-level grayscale sprites moving quickly?

Below are GIFs of the program displaying 3-level grayscale (above) and 4-level grayscale (below). They play in full speed on my computer, with any luck they will for anyone else viewing them too.
« Last Edit: May 17, 2010, 08:09:31 pm by Runer112 »

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Axe Parser
« Reply #607 on: May 17, 2010, 05:00:43 pm »
Those look really nice!  Awesome job! ;D
The 4lvl looks a little choppier.  =/

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Axe Parser
« Reply #608 on: May 17, 2010, 05:47:34 pm »
Those look awesome! Great job. Though the 4-level gray scale is a little choppy I do like the little outline around the character.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Parser
« Reply #609 on: May 17, 2010, 06:26:53 pm »
Dammit. Just did a bunch of code shifting and re-organizing for my program from 3 posts ago on my computer, and when I tried to send it to my calculator, it said it couldn't because "the device is in a low battery state" >:(

P.S. If anybody has any ideas for efficient raytracing raycasting, feel free to share, because I'll need something of the like for the game I'm working on. ;) In my case though, the floor, walls, and ceiling will simply be composed of black and white squares and the point of view won't change quickly, so I'll probably end up drawing everything the slow way to start and then just shifting things by drawing and erasing lines on the sides. Sort of like video codecs that start by encoding a full key frame but then just encoding changes from frame to frame instead of encoding every single frame.
« Last Edit: May 19, 2010, 09:54:26 pm by Runer112 »

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Axe Parser
« Reply #610 on: May 17, 2010, 09:20:39 pm »
The only way to make it look cleaner is to update the screen more often between frames (slow it down) becasue 4 bit gray needs to be drawn in the same place for 3 frames to guarantee a cycle through all the gray.  That's becasue the pixels stay black for 0,1,2, or 3 times during the duration of 3 frames to get the white, light gray, dark gray, and black.  By contrast, 3 bit gray only needs to be drawn 2 times between frames for a smooth animation (but still, more looks better).  That's why most 4 color grayscale games, like desolate, don't generally feature a lot of motion at once.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Axe Parser
« Reply #611 on: May 17, 2010, 11:22:15 pm »
that looks nice. Usually it's inevitable flicker will occurs when the sprite moves around at very high frame rate. But Quigibo advice should help.

Offline Tribal

  • The Fallen
  • LV5 Advanced (Next: 300)
  • *
  • Posts: 218
  • Rating: +15/-1
    • View Profile
Re: Axe Parser
« Reply #612 on: May 18, 2010, 04:30:32 pm »
Raytracing or Raycasting? Raytracing is much more complex, and I do not know of any raytracing ever done on a calculator.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Axe Parser
« Reply #613 on: May 18, 2010, 04:32:11 pm »
There is for the TI-Nspire, but it takes several seconds to render, if I remember

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Axe Parser
« Reply #614 on: May 18, 2010, 06:44:49 pm »
Raytracing or Raycasting? Raytracing is much more complex, and I do not know of any raytracing ever done on a calculator.

Whoops my bad. I deliberately looked the two up before I posted that to make sure I didn't mix them up, but I guess I mixed them up anyways lol.
« Last Edit: May 18, 2010, 06:45:18 pm by Runer112 »