Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: Michael_Lee on October 17, 2010, 10:40:42 pm

Title: Light
Post by: Michael_Lee on October 17, 2010, 10:40:42 pm
So I was thinking of making a new game, based around a single gameplay mechanic: light and shadows.
I was planning on making a rogue-like game (where you descend endlessly down a randomly generated dungeon, finding treasures, killing monsters, and avoiding traps and whatnot).
I decided that it would be cool to add light and shadow to the game, so that it's like you're in a DARK dungeon, emanating light (and it's scary - what could be lurking around the next corner?)

Sadly, it's extremely slow - this is an Axe assembly program going at full speed on an TI-84+SE, and moving the circle feels like pulling teeth.

Any optimization suggestions, please?
(I'm using a variant of Bresenham's line algorithm, for those interested)

Also: how fast does pxl-Test work?  And the line( command?

Code: [Select]
.LIGHT
Full
DiagnosticOff
Fix 5
Fix 9
Fix 0
ClrDraw
ClrDraw[radians]

[FFFFFFFFFFFFFFFF]->PIC1
[3844828282443800]->PIC2
45->A->B
0->C
sub(MAP)
Pt-On(A-3,B-3,PIC2)
DispGraph
::While 1
If getKey(15)
Goto END
End
getKey(1)-getKey(4)->E
getKey(3)-getKey(2)->D

If D or E
ClrDraw
A+D->A
B+E->B
sub(MAP)
For(C,0,64)
sub(LIN,A,B,96,C)
sub(LIN,A,B,0,C)
End
For(C,1,95)
sub(LIN,A,B,C,64)
sub(LIN,A,B,C,0)
End
Pt-On(A-3,B-3,PIC2)
0->C
DispGraph
:End

::End

Label MAP
For(F,0,7)
For(G,0,1)
Pt-On(G*16,F*8,PIC1)
Pt-On(G*16+72,F*8,PIC1)
End
Pt-On(F*8+16,0,PIC1)
Pt-On(F*8+16,56,PIC1)
End
Pt-Change(16,24,PIC1)
Pt-Change(72,32,PIC1)
For(F,0,1)
For(G,0,1)
Pt-On(F*24+32,G*24+16,PIC1
End
End
Return



Label LIN
If abs(R4-R2)>abs(R3-R1)->U
expr([degrees]R1,[degrees]R2,2)
expr([degrees]R3,[degrees]R4,2)
End
R1>R3->K
abs(R3-R1)->S/2->V
abs(R4-R2)->T
R2<R4*2-1->W
R2->Y
For(Z,R1,abs(R3-R1)+R1)
If K
2*R1-Z->X
Else
Z->X
End
getKey(15)*9+W->W
ReturnIf getKey(15)
If U
If pxl-Test(Y,X)
Line(Y,X,R4,R3)
Return
End
Else
If pxl-Test(X,Y)
Line(X,Y,R3,R4)
Return
End
End

V-T->V
If V>99
Y+W->Y
V+S->V
End
End
Return

Label END
Fix 4
Title: Re: Light
Post by: tloz128 on October 17, 2010, 10:46:59 pm
Woah! Pseudo 3d awesomeness!
Oh, and for optimizations, how about drawing the screen once every two runs through the loop instead of every time?
Title: Re: Light
Post by: meishe91 on October 17, 2010, 10:53:16 pm
So is it kind of like a birds-eye-view 3D adventure type game? It looks cool, I hope you get the speed worked out :)
Title: Re: Light
Post by: SirCmpwn on October 17, 2010, 11:00:46 pm
That is REALLY cool.  I do suggest making the shadows grayscale, however.
Title: Re: Light
Post by: ztrumpet on October 17, 2010, 11:03:29 pm
That looks awesome!  By the way, if you think you can read the algorithms, there's this wonderful program: http://www.ticalc.org/archives/files/fileinfo/226/22637.html
I love that game on my 86. ;D

Here's the source: http://www.ticalc.org/archives/files/fileinfo/226/22638.html
Title: Re: Light
Post by: nemo on October 17, 2010, 11:04:27 pm
That is REALLY cool.  I do suggest making the shadows grayscale, however.

i second this. but instead of drawing lines to the backbuffer, draw the lines as you are now every other frame. that way you gain speed, and the shadows now appear gray.
Title: Re: Light
Post by: meishe91 on October 17, 2010, 11:07:35 pm
Oh, those are shadows! I totally thought those were like columns coming up at you :P That makes more sense now about the light thing. Ya, gray shadows would be cool :)
Title: Re: Light
Post by: AngelFish on October 17, 2010, 11:21:53 pm
Any optimization suggestions, please?
(I'm using a variant of Bresenham's line algorithm, for those interested)

It looks awesome, but why are you using that algorithm? It could very well be faster to set the initial screen and adjust the start/end points of the Line( function (which already uses Bresenham's algorithm).
Title: Re: Light
Post by: _player1537 on October 17, 2010, 11:33:29 pm
I think the algorithm is to allow a straight line to be drawn from the player to the next pillar (or from the pillar to the edge of the screen)  Qwerty is kinda right though, there is already a line routine written in ASM, if you can get the code for that routine and edit it apropriately, you can get the same routine but 9001% faster.  Quigibo released the source a long time ago, so you might want to look for it, if you (or anyone) can't find it, I'll edit my post.
Title: Re: Light
Post by: DJ Omnimaga on October 17, 2010, 11:37:26 pm
Wow that seems slow but looks AWESOME! It brought me back awesome memories from Blinded By The Dark! I hope you can make it faster. :)
Title: Re: Light
Post by: Michael_Lee on October 17, 2010, 11:38:10 pm
Any optimization suggestions, please?
(I'm using a variant of Bresenham's line algorithm, for those interested)

It looks awesome, but why are you using that algorithm? It could very well be faster to set the initial screen and adjust the start/end points of the Line( function (which already uses Bresenham's algorithm).

I'm using the algorithm to test when the shadows should start.  The algorithm tests all the points in the line, and when it encounters a black pixel, it switches over to the built in line( function to draw it.

--
Okay, grayscale it is!
--
Anybody know where I can find a TI-86 emulator?  I wanna try Blinded by the Dark.
Title: Re: Light
Post by: DJ Omnimaga on October 17, 2010, 11:43:31 pm
There's VirtualTI on ticalc.org but you need a 86 ROM.

Btw what makes the grayscale faster than monochrome? O.O
Title: Re: Light
Post by: _player1537 on October 17, 2010, 11:53:32 pm
It makes it prettier :)
Title: Re: Light
Post by: DJ Omnimaga on October 18, 2010, 12:22:53 am
Ah ok.
Title: Re: Light
Post by: _player1537 on October 18, 2010, 12:26:18 am
Actually, it just occured to me that it'd be *really* easy to add greyscale with the way greyscale is currently set up.  Store the layer you get from here, to the backbuffer, and copy-pasta the main image that you are doing collision tests with to the front buffer and blamo!  Greyscale shadows :D
Title: Re: Light
Post by: DJ Omnimaga on October 18, 2010, 12:28:15 am
Yeah true, it's incredible how easy GS is to achieve in Axe compared to ASM and xLIB/DCS
Title: Re: Light
Post by: Builderboy on October 18, 2010, 04:11:37 am
This is looking awesome! Possibly to gain some speed, you could try 2x2 pixels instead of 1x1 and it would get 4 times faster maybe?  You wouldn't be able to use the Axe line function but it sounds like you already have your own :D Me and Eeems were working on a similar game concept earlier but it didn't go anywhere.  I looked into blinded by the dark code but i couldn't make any sense of it :( and they use some sort of tricky algorithm since it can have multiple light sources.

Overall i think this is looking awesome! :D
Title: Re: Light
Post by: Eeems on October 18, 2010, 09:18:55 am
Builderboy, it could still go somewherw :p you and I just need to put our heads together more
Title: Re: Light
Post by: DJ Omnimaga on October 18, 2010, 02:58:12 pm
/me wonders if that is related to their secret project or something :P
Title: Re: Light
Post by: Builderboy on October 18, 2010, 05:03:32 pm
Its actually highly related ^-^
Title: Re: Light
Post by: Michael.3545 on October 18, 2010, 05:16:23 pm
The problem with grayscale shadows is then you can see the whole map, regardless of where you are standing.  Then the shadows become more of an effect that a gameplay mechanic. 

(Is gameplay mechanic the right term here?  I'm not really sure...)

I thought the entire idea of games like these is for you not to know what is around you without actually physically going there.
Title: Re: Light
Post by: DJ Omnimaga on October 18, 2010, 05:24:56 pm
Yeah true, although maybe he plans to use the shadows to hide enemies and stuff, idk (Like Starcraft 2).

Btw nice to see you around again on the forums Michael :D
Title: Re: Light
Post by: matthias1992 on October 18, 2010, 05:29:12 pm
Looks great! Keep us posted!
Title: Re: Light
Post by: MRide on October 18, 2010, 06:10:06 pm
The problem with grayscale shadows is then you can see the whole map, regardless of where you are standing.  Then the shadows become more of an effect that a gameplay mechanic. 

(Is gameplay mechanic the right term here?  I'm not really sure...)

I thought the entire idea of games like these is for you not to know what is around you without actually physically going there.
Yeah true, although maybe he plans to use the shadows to hide enemies and stuff, idk (Like Starcraft 2).

Btw nice to see you around again on the forums Michael :D
Well, he could make it so anything in the shadows is grey, and the walls that you can see are black.
Title: Re: Light
Post by: Deep Toaster on October 18, 2010, 07:02:16 pm
Any optimization suggestions, please?
(I'm using a variant of Bresenham's line algorithm, for those interested)

It looks awesome, but why are you using that algorithm? It could very well be faster to set the initial screen and adjust the start/end points of the Line( function (which already uses Bresenham's algorithm).

I'm using the algorithm to test when the shadows should start.  The algorithm tests all the points in the line, and when it encounters a black pixel, it switches over to the built in line( function to draw it.

--
Okay, grayscale it is!
--
Anybody know where I can find a TI-86 emulator?  I wanna try Blinded by the Dark.

Wabbit supports 86s, I think.

And btw, that looks awesome :D

EDIT: Yep, just tested. 86 works perfectly on Wabbit. Even 85s, even though they use the 86 skin.
Title: Re: Light
Post by: DJ Omnimaga on October 18, 2010, 08:29:05 pm
I thought 86 support was limited and 85 absent?
Title: Re: Light
Post by: Deep Toaster on October 18, 2010, 08:31:40 pm
Must have been a while ago. I kept bugging him about it until it worked ;D
Title: Re: Light
Post by: Michael_Lee on October 26, 2010, 06:50:53 pm
After procrastinating for days (curse you, cuberunner!), I finally managed to implement a variant on Builderboy's suggestion and made the game check every two pixels for collisions.
Which means that now, instead of being excruciating, it's just a little slow!  (Yay!)

Because I couldn't decide between black or grayscale shadows, I added both.  You press alpha to alternate between the two.  (I got a little lazy implementing it, so you have to come to a complete stop, press alpha really quickly if your emulator is fast, then start moving for it to switch).

Next:  Collision detection.  And plot.  And more optimizing, if possible.
Title: Re: Light
Post by: MRide on October 26, 2010, 10:50:00 pm
Looks good.  Like I said earlier, if you're going to do greyscale shadows, I would make anything in shadows grey, otherwise there is no point.
Title: Re: Light
Post by: DJ Omnimaga on October 27, 2010, 02:05:31 am
Looks nice :D
Title: Re: Light
Post by: calcdude84se on October 29, 2010, 11:00:41 pm
Looks cool!
Random question, though: why did the screenie show "Asm " and not "Asm(" ???
Title: Re: Light
Post by: ztrumpet on October 29, 2010, 11:05:08 pm
Wow, how'd I miss this? 
It looks great Michael! ;D
Title: Re: Light
Post by: squidgetx on October 30, 2010, 12:47:51 pm
What MRide said about making sure shadowed objects are grey. Probably black is best (like Builderboy's Nightmare) , since it would add a *little* speed

After procrastinating for days (curse you, cuberunner!)

heh heh.... >:D
Title: Re: Light
Post by: Michael_Lee on November 01, 2010, 07:24:51 pm
Well, coding is going along slowly, in fits and starts, but progress is being made.
I think I have a plot, and I want to run it through the forum to see what you guys think.

You control a villain (whose name, btw, is Harlequin) who lives in a lair in the depths of a maze.  Because you are a villain (and a particularly nasty one, to boot), your maze is perpetually flooded with would-be heroes attempting to confront you.  As a result, you're kept quite busy running about, resetting traps, killing tenacious heroes, etc.

One day, you were foiling heroes, as usual, when you accidentally triggered your own trap, which caused all of your equipment and stuff to scatter about, and more importantly, caused you to lose the all-important map of the maze, leaving you completely, totally, and utterly lost.  Which sucks for you.

The purpose of the game is to go around collecting equipment from treasure chests, rearming (and avoiding) traps, killing heroes you encounter, recovering map pieces, solving puzzles by pressing buttons that open/shut pathways/doors, and attempting to convince henchmen that you are, in fact, Harlequin, and not some impostor.
Title: Re: Light
Post by: DJ Omnimaga on November 01, 2010, 07:32:33 pm
Ooh nice, I like the idea, because it is not just the typical "A vilain with OVER 9000! magic powerz is threatening the kingdom and you must save the world" story style, which can be good, too, but different stuff is nice, sometimes. One thing I wonder, though: will there be NPCs and some form of shops or something to upgrade your equipment and to get clues?

Also I'll probably create a sub-forum for this later, unless Hot Dog beats me to it. :)
Title: Re: Light
Post by: Michael_Lee on November 01, 2010, 07:37:10 pm
Ooh nice, I like the idea, because it is not just the typical "A vilain with OVER 9000! magic powerz is threatening the kingdom and you must save the world" story style, which can be good, too, but different stuff is nice, sometimes. One thing I wonder, though: will there be NPCs and some form of shops or something to upgrade your equipment and to get clues?

Also I'll probably create a sub-forum for this later, unless Hot Dog beats me to it. :)
Thanks!
I think I'll add interaction with various henchmen, as either sources of dialogue or to buy and sell stuff.  (Pretty degrading stuff for a supervillain to stoop to,having to buy equipment from your own henchmen, lol)
Title: Light - Progress
Post by: Michael_Lee on November 02, 2010, 06:42:03 pm
Updates and screenshots will go in this thread.

November 2nd, 2010:
Real updates:
> Got shadows to respond faster
> Made character movement smoother
> Made the map scroll, not the character

Superficial updates:
> Switched to a new map
> Made tile engine slightly more extendable
> Made the viewing screen square, not rectangular. (Going to add stats and stuff to the right side)

Things I'm working on:
> Making a flexible tilemapper that can display more then walls
> Making the plot more detailed

Things I really need to start working on
> Adding interaction (traps, items, etc.)
> Adding menu systems
> Adding stats

Note:
I'm probably going to keep grayscale shadows the way it is now, so it functions as a way for me to easily see the layout of my maps and serve as a sort of lightbulb feature.

Another note:
Wheee!!  This is fun, having a progress thread.
Title: Re: Light - Progress
Post by: SirCmpwn on November 02, 2010, 06:45:30 pm
Awesome!  Looks great!
Title: Re: Light - Progress
Post by: Darl181 on November 02, 2010, 07:06:46 pm
There's a Full in there, I can tell.  The screen messes up on the 84+.

EDIT: yes, when I put normal before every
Code: [Select]
DispGraph[sup]r[/sup]and full after, it works
Title: Re: Light - Progress
Post by: SirCmpwn on November 02, 2010, 07:07:57 pm
Worked fine on an emulated TI-84+.  The source is included though, so you could always just fix it yourself :P
Title: Re: Light - Progress
Post by: Michael_Lee on November 02, 2010, 07:11:58 pm
There's a Full in there, I can tell.  The screen messes up on the 84+.

EDIT: yes, when I put normal before every
Code: [Select]
DispGraph[sup]r[/sup]and full after, it works

Could you describe exactly how the screen messes up?  If it's possible, could you also upload a screenshot?
Title: Re: Light - Progress
Post by: Darl181 on November 02, 2010, 07:48:03 pm
It's kind of like this screenshot in Sprite Helpers (http://ourl.ca/4832/94303)

It's not your program, it's that grayscale messes up in Full mode.
(And in the link, look at the post just below the screenshots)
Title: Re: Light - Progress
Post by: DJ Omnimaga on November 02, 2010, 07:56:24 pm
The delay is too slow for 15 MHz, so to use grayscale in 15 MHz you need to do:

Normal
DispGraphTheGame
Full

By the way that's awesome! I wonder if you should make the character move every 2 pixel or something so it is faster?
Title: Re: Light - Progress
Post by: Michael_Lee on November 02, 2010, 08:04:20 pm
By the way that's awesome! I wonder if you should make the character move every 2 pixel or something so it is faster?
Well, that's actually what it's doing.  Every time I move, the calculator starts crunching where to add the shadows two pixels later, but interrupts halfway through to display an intermediate circle position without rendering new shadows.  Which is why the shadows are a little choppy but the circle isn't.
Title: Re: Light - Progress
Post by: DJ Omnimaga on November 02, 2010, 08:09:03 pm
Oh ok, I meant the circle movement too
Title: Re: Light - Progress
Post by: Broseph Radson on November 02, 2010, 09:07:31 pm
DispGraphTheGame

NNNNUUUUUUUUUU-
Title: Re: Light - Progress
Post by: MRide on November 02, 2010, 09:38:48 pm
Lol.  btw, Michael, I notice the room shows up for a little bit before the shadows appear.  Maybe you could adjust the contrast so people can't tell?
Title: Re: Light - Progress
Post by: DJ Omnimaga on November 02, 2010, 09:46:27 pm
There is another idea I had, but I think it might not look pretty all the time:

What about only updating certain portions of the screen in a frame, then another, then another? Would that help improving speed? Alternatively, you could update shadows less often, like the fog of War in Starcraft. In Starcraft, I think fog of war is updated at like 6 FPS max.

Title: Re: Light - Progress
Post by: Michael_Lee on November 12, 2010, 06:57:59 pm
Update (mostly to prove that I'm not dead).

It's been proving nearly impossible to up the speed (and I don't really want to progress without increasing the speed of the shadows), but I've done some drastic optimizations to the shadow routine, so I think the problems in my tilemapping routine.
Also, I've been doing some planning, so I have the schematics of the first level done, I've planned out how health bars, items, and traps will go.
Right now I'm attempting to make a tilemap editor so I can actually try making a better tilemap. 

After some tests:
Worst case scenario w/ simple map routine: 2.9 FPS
Normally: 2.8 FPS

x.x
Title: Re: Light - Progress
Post by: MRide on November 12, 2010, 07:00:45 pm
It's been proving nearly impossible to up the speed (and I don't really want to progress without increasing the speed of the shadows), but I've done some drastic optimizations to the shadow routine, so I think the problems in my tilemapping routine.
Did you check out the smooth scrolling tilemapper thread? there were some insanely fast tilemappers in there.
Title: Re: Light - Progress
Post by: Michael_Lee on November 12, 2010, 07:02:05 pm
I did.  I'm working on deciphering Runer112's tilemap program, but I'm still not entirely sure how it works.
Title: Re: Light - Progress
Post by: MRide on November 12, 2010, 07:02:56 pm
I think that's b/c it's crazy optimized.  See if you can get the un-optimized version and compare the two.
Title: Re: Light - Progress
Post by: Michael_Lee on November 12, 2010, 07:04:24 pm
I've been looking at the unoptimized one (the first one he released, I think?). 
I looked at the uber-optimized one, and decided that that was an adventure for another day.
Title: Re: Light - Progress
Post by: MRide on November 12, 2010, 07:08:16 pm
Oh.  Yeah, I also have difficulty understanding someone else's code.  I don't know what they were thinking when they wrote it.  (Which is why commented code is much easier for me to understand)
Well, good luck! I hope you can make this faster.  It's a really cool concept.
I have an idea for a different light-dark game, but that's on my "plan to plan to do list," so it will be awhile. :P
Title: Re: Light - Progress
Post by: Michael_Lee on November 12, 2010, 07:26:55 pm
Well, crap.  It's not my tilemap routine.  *Sigh*
Title: Re: Light - Progress
Post by: MRide on November 12, 2010, 07:59:20 pm
Actually, the speed looks better than before.
Have you considered not having the map scrolling every time you move?
Title: Re: Light - Progress
Post by: DJ Omnimaga on November 13, 2010, 02:58:38 am
Yeah it seems a bit faster. However, have you tried what I posted the other day (the post that contains a Youtube vid)? Would it help improving speed?

I'm glad this is still alive, though.
Title: Re: Light - Progress
Post by: DJ Omnimaga on November 25, 2010, 08:54:18 pm
Hey, have you got any luck with this lately? I am wondering if you have considered toning down the complexity of the light engine by simply updating one row on the screen per frame or maybe even updating it only when reaching the middle of a tile?

This may not look as great, but maybe it would increase the speed?

I think the first method might not be feasible with Line, though. Maybe you would have to use a set of sprites with diagonal stuff drawn on them. Anyway here's what I mean:
Title: Re: Light - Progress
Post by: Michael_Lee on November 25, 2010, 09:13:35 pm
I'm actually taking a small break on my project.
In my attempts to optimize, I entangled and combined many part of my program together in a manner that makes it tedious to pry apart/rewrite.
I'm still working on other parts, such as a tilemapper and the beginnings of the menu, but in order to allow me to get a fresh perspective on the problem, I'm currently working on another shorter project (with a demo which I can probably release either today or tomorrow, or at the latest, Saturday).

Unless I can get the shadow algorithm to run respectably fast, this project will probably have to be shelved indefinitely.
Title: Re: Light - Progress
Post by: DJ Omnimaga on November 25, 2010, 09:17:17 pm
Ah ok I see, I'm glad you're still working on stuff. I hope this project doesn't die, though. Have you thought about posting your source so someone can figure out if he can help optimizing? Someone could maybe write an algorithm in ASM to do the lights part of your game.
Title: Re: Light - Progress
Post by: Michael_Lee on November 25, 2010, 09:25:03 pm
Well, the most recent workable sources are all available on this thread.  When programming on the highly volatile platform combined with the highly dangerous language that is Axe on z80 calculators, I generally think it's a good idea to disseminate sources as much as possible to guard against RAM crashes.
I think getting somebody to rewrite the portion in assembly might be a last-resort kind of idea, but I'll definitely keep it in mind. 

[RANDOM THOUGHT]You should add the quote "I hope your project doesn't die" to your signature![/RANDOM THOUGHT]
Title: Re: Light - Progress
Post by: DJ Omnimaga on November 25, 2010, 09:31:20 pm
Ah ok I forgot to check ;D

Hopefully a solution can be found. :)

At the very worst case you could always do it the Joltima way but have corners using triangle tiles instead of squares, or something like that.

EDIT: About signature edit... I had another idea recently, but I forgot. X.x
Title: Re: Light - Progress
Post by: Michael_Lee on November 25, 2010, 09:32:23 pm
At the very worst case you could always do it the Joltima way but have corners using triangle tiles instead of squares, or something like that.

Wait, what? 
*Music scratches to a halt

What would that do?
Title: Re: Light - Progress
Post by: DJ Omnimaga on November 25, 2010, 09:57:39 pm
See first screenshot (animated):

http://www.ticalc.org/archives/files/fileinfo/76/7671.html

As for triangles I mean like this:
Title: Re: Light - Progress
Post by: Runer112 on November 25, 2010, 10:39:25 pm
I did.  I'm working on deciphering Runer112's tilemap program, but I'm still not entirely sure how it works.

I think that's b/c it's crazy optimized.

Correct! I often struggle to decipher my optimized code, which is why I usually try to force myself to add more comments than I think I need so I can understand it at a later time. However, it looks like I didn't comment my tilemapper much. Want me to go back and comment it?
Title: Re: Light - Progress
Post by: DJ Omnimaga on November 26, 2010, 12:19:55 am
Just try to make sure there aren't way too many either so it still fits in his RAM ;D (he could use it as external sub-routine I guess, though)
Title: Re: Light - Progress
Post by: Michael_Lee on November 26, 2010, 11:02:41 pm
I did.  I'm working on deciphering Runer112's tilemap program, but I'm still not entirely sure how it works.

I think that's b/c it's crazy optimized.

Correct! I often struggle to decipher my optimized code, which is why I usually try to force myself to add more comments than I think I need so I can understand it at a later time. However, it looks like I didn't comment my tilemapper much. Want me to go back and comment it?

I appreciate the offer, but I think I've managed to understand the tilemap moving part well enough that comments really aren't necessary.  (The tilemap creation part, however, is... difficult to follow, but strictly speaking, I don't need it for my project).  If you have time though, making the guide to Axe optimization that you mentioned on the tilemap thread would be pretty cool, though (poke, poke).
Title: Re: Light - Progress
Post by: MRide on November 27, 2010, 12:44:01 pm
I did.  I'm working on deciphering Runer112's tilemap program, but I'm still not entirely sure how it works.

I think that's b/c it's crazy optimized.

Correct! I often struggle to decipher my optimized code, which is why I usually try to force myself to add more comments than I think I need so I can understand it at a later time. However, it looks like I didn't comment my tilemapper much. Want me to go back and comment it?
Wait...you optimize your code so much you can't understand it? :o

EDIT: I have now passed the divide...
Title: Re: Light - Progress
Post by: DJ Omnimaga on November 28, 2010, 10:12:44 am
Another trick can also be to split your game source in sub-routines. That can help making the code easier to read.
Title: Re: Light - Progress
Post by: MRide on November 29, 2010, 06:14:05 pm
True.  I kind of wish that TI BASIC allowed things like C++, where the subroutines/procedures are all in one file.  Like Axe.
Title: Re: Light - Progress
Post by: DJ Omnimaga on November 30, 2010, 02:13:57 am
Well, there's BasicBuilder, but it's not very reliable. Programs run slower, lots of pic stuff need to be renamed, xLIB/DCS sprite/map/pic commands won't work with internal BB pics, there are no archived program support and it's limited to 1 page apps. Hence why none of my old games use it.
Title: Re: Light - Progress
Post by: Michael_Lee on December 26, 2010, 02:00:17 pm
Well, holy crap.

I wanted to see how fast Axe 0.4.7's new line commands were, so I compiled a version I had on the computer using both Axe 0.4.6 and 0.4.7 (see screenshots below)

If this is how the speed is like even without me fully using the new commands of 0.4.7...

My motivation just went up by over nine thousand.  :hyper: :w00t: :hyper:
Title: Re: Light - Progress
Post by: TIfanx1999 on December 26, 2010, 02:08:16 pm
That is a nice increase. Very cool! =)
Title: Re: Light - Progress
Post by: Eeems on December 26, 2010, 03:53:43 pm
wow! that's a huge increase!
Title: Re: Light - Progress
Post by: DJ Omnimaga on December 26, 2010, 04:16:54 pm
Woah that's a huge increase indeed! Does this means the project might be revived soon? :D
Title: Re: Light - Progress
Post by: calcdude84se on December 26, 2010, 05:13:57 pm
I second DJ's question. I hope you take this up again! :D
Title: Re: Light - Progress
Post by: Eeems on December 26, 2010, 05:28:20 pm
I second DJ's question. I hope you take this up again! :D
++
Title: Re: Light - Progress
Post by: jnesselr on December 26, 2010, 05:52:55 pm
Is there a sample version that we can test with it? I wonder if you can increase the speed more.
Title: Re: Light - Progress
Post by: Michael_Lee on December 26, 2010, 06:59:40 pm
Before today, I wasn't too sure if I would continue this project because I couldn't get the shadow effect to run at a fast enough speed to merit making any kind of game based on the effect.
However, with the faster line commands plus drawing lines to backbuffer, I could actually increase the speed even more (I hope)
Using the shadow effect is definitely feasible now, so I'll be resuming this project.
Title: Re: Light - Progress
Post by: calcdude84se on December 26, 2010, 08:24:35 pm
Yay! Good luck and best of wishes to you, sir! :D
Title: Re: Light - Progress
Post by: DJ Omnimaga on December 27, 2010, 03:41:28 pm
Have you found even more speed optimizations right now?
Title: Re: Light - Progress
Post by: Michael_Lee on December 27, 2010, 06:54:07 pm
Ah, well, not yet.  After Christmas is always a bit busy (running around, cleaning, using up gift cards, etc), so I'll probably resume coding this evening.
Title: Re: Light - Progress
Post by: DJ Omnimaga on December 27, 2010, 10:45:10 pm
Ah ok, good luck with all the stuff :D
Title: Re: Light - Progress
Post by: Builderboy on December 28, 2010, 01:43:24 am
Wow thats an awesome increase in speed! Is it running in 6Mgz or 15Mgz now?
Title: Re: Light - Progress
Post by: DJ Omnimaga on December 28, 2010, 02:02:52 am
MHz* :P
Title: Re: Light - Progress
Post by: Michael_Lee on December 28, 2010, 10:18:16 am
Still 15 MHz (sadly).
Title: Re: Light - Progress
Post by: DJ Omnimaga on December 28, 2010, 07:55:26 pm
I think it's still good, though. I am really curious how the speed will increase when you change the things you planned to change, though.
Title: Re: Light - Progress
Post by: ztrumpet on December 29, 2010, 10:58:31 pm
Wow!  This is a great increase.  Excellent! ;D
Title: Re: Light - Progress
Post by: Builderboy on December 30, 2010, 12:35:07 am
Its an awesome increase :D I also had an idea.  Might it be possible to have a beam of light (possibly 90 degrees) instead of a full circle?  This would drastically reduce the amount of raycasting needed, and also might be used as a further game element.
Title: Re: Light - Progress
Post by: DJ Omnimaga on December 30, 2010, 12:23:53 pm
You mean like in Nightmare? That might actually be more realistic, actually, since normally you can't even see behind you.
Title: Re: Light - Progress
Post by: squidgetx on December 30, 2010, 12:44:24 pm
Out of curiosity, how are you casting your rays? Are you using a trig-based method, or the bresenham algorithm you posted in the routines thread a while back?
Title: Re: Light - Progress
Post by: Michael_Lee on December 30, 2010, 04:51:55 pm
Its an awesome increase :D I also had an idea.  Might it be possible to have a beam of light (possibly 90 degrees) instead of a full circle?  This would drastically reduce the amount of raycasting needed, and also might be used as a further game element.

Yah, I guess I could do this, but I'm slightly worried about the possibility that the player might then just be lost because they lack enough info to know where they're going and they'll end up just stumbling around in the dark... (which is actually more realistic then I have now, but not as fun :P)

Out of curiosity, how are you casting your rays? Are you using a trig-based method, or the bresenham algorithm you posted in the routines thread a while back?
I'm using the bresenham algorithm, except much more optimized.  I'll actually post what I have in a minute (although there aren't many improvements yet), as soon as I back up my calc...
Title: Re: Light - Progress
Post by: Builderboy on December 31, 2010, 01:57:53 am
Maybe what you could do is have a beam of light, but also have a circle of light around the player no matter what.  (Basically the shadow beams always start out a certain distance from the player before they can start casting shadows).  That way it still has a beam but you can still see whats really close to you.

You should check out this game http://www.kongregate.com/games/Jiggmin/neverending-light it has a shadow effect and is one of my most inspirational and favorite flash game :)
Title: Re: Light - Progress
Post by: Steelm on February 15, 2011, 10:13:28 pm
AWESOME
Title: Re: Light - Progress
Post by: Builderboy on February 15, 2011, 10:18:51 pm
Steelm, I've noticed you seem to be spamming the forum with random single word comments.  Please refrain from posting spam if you don't have anything constructive to say, as well as try to look at the post date to make sure you are not posting on threads that have died out a while ago.  This is a warning, any more spam and you will be banned.
Title: Re: Light - Progress
Post by: DJ Omnimaga on February 15, 2011, 11:48:09 pm
On a side note did he get any PM warning? I generally warn via PM but sometimes people won't notice (not that it matters, though. If I ever ban someone I put in the ban message that the person was warned already)
Title: Re: Light - Progress
Post by: PeonHero on February 16, 2011, 12:23:13 am
nice program
Title: Re: Light - Progress
Post by: ikemike on May 29, 2011, 12:48:53 am
I wonder if this engine could be used for a pseudo-3D game... When I look at the screenshots I think GTA.
Title: Re: Light - Progress
Post by: DJ Omnimaga on May 29, 2011, 01:17:56 am
Hmm that might be a bit too much for Axe, but I guess it wouldn't hurt to try. I hope Michael works again on this eventually by the way.
Title: Re: Light - Progress
Post by: Deep Toaster on June 04, 2011, 09:43:25 am
Just realized it's a lot like this game: http://www.addictinggames.com/arcade-games/find-exit-game.jsp

Maybe try porting it? :D
Title: Re: Light - Progress
Post by: ztrumpet on June 04, 2011, 11:33:15 am
Just realized it's a lot like this game: http://www.addictinggames.com/arcade-games/find-exit-game.jsp

Maybe try porting it? :D
I just made it through 10 levels of that, and I'd love to see it on the calc.  That's an awesome game. :D
Title: Re: Light - Progress
Post by: DJ Omnimaga on June 12, 2011, 02:24:22 am
Actually Light kinda reminds me of Builderboy's Nightmare game now. I wonder if a calc port of nightmare would be possible?

By the way I wonder where has Michael_Lee been recently? ???
Title: Re: Light - Progress
Post by: Michael_Lee on June 13, 2011, 05:34:02 pm
I wonder if this engine could be used for a pseudo-3D game... When I look at the screenshots I think GTA.

I'm afraid that currently, my engine is too slow for much of anything.
I've optimized it as much as I know how, but it's too slow inherently: I'm probably going to have to redo most of it.


Just realized it's a lot like this game: http://www.addictinggames.com/arcade-games/find-exit-game.jsp

Maybe try porting it? :D

I'm behind a filter: what's the game like?
Is there an equivalent version for android phones floating around?
Is there a youtube video somewhere?
Title: Re: Light - Progress
Post by: Deep Toaster on June 14, 2011, 11:11:33 am
It's similar in that when you're in a maze, and when you move, you "light up" the path in open directions.