PDA

View Full Version : E's Lua Dev Thread



jman420
July 18th, 2006, 01:26
Hello all, I once again have a release of a Lua app

(nudge, poke *cough* coder status *cough*)

Its a remake of Y's the Vannished Omens originaly for Sega Master System, now for Lua..

It includes Character animation, walking behind buildings, scrolling backgrounds, and soon will have collision.

Its not programmed with all the newest techniques, but I felt that I should keep it simple and still functional..

please give comments - feedbacks..
And if someone could post this on the news forum, that would be great.

Gizmo356
July 18th, 2006, 01:29
awesome *cough* coder stadus *caugh*

Zion
July 18th, 2006, 01:38
Nice work Jman :D This is going to be an awsome game :D

BL4Z3D247
July 18th, 2006, 01:41
awesome *cough* coder stadus *caugh*
LMAO...yo jman downloadin now.............loadiiiiiiiin......dude with ur talent this games gunna kick major @$$, awesome work :D

Shadowblind
July 18th, 2006, 01:47
Based on everybody's posts, this looks to be a good game (I cant download it right now)

Any way I can help?

jman420
July 18th, 2006, 01:55
well thanks shadowblind, but I think I will do my own 3D work for the game.

I have accualy modeled the intire town in 3D and rendered off the images, and I will eventualy model a character in 3D and make my own sprites..

Thanks for the positive posts all! Its nowhere even near done, I have only started the process of making it, but I will try to update it when I can.. ( I dont have much time because of other 3D stuff I need to get done, and I just got Resident Evil Deadly Silence for my DS so I will probobly be playing that untill I beat it :D

BL4Z3D247
July 18th, 2006, 02:07
well thanks shadowblind, but I think I will do my own 3D work for the game.

I have accualy modeled the intire town in 3D and rendered off the images, and I will eventualy model a character in 3D and make my own sprites..

Thanks for the positive posts all! Its nowhere even near done, I have only started the process of making it, but I will try to update it when I can.. ( I dont have much time because of other 3D stuff I need to get done, and I just got Resident Evil Deadly Silence for my DS so I will probobly be playing that untill I beat it
dude i like the 3D, can't wait for the character to be 3D :D...have fun playin ur RE: Deadly Silence, lookin forward to the next release

jman420
July 18th, 2006, 02:27
wow, thanks for flaming my thread so soon, I'm so happy that now every time someone looks at my thread on my project, they can be offended.. good thinking gizmo

Edit: thanks for deleating it, but that kinda stuff is not what you put on a forum, A, complete flamage, and B it was somthing thats just not cool for other people to read on a forum about a video game, if it had some sort of relevence, it could have been funny.. but it wasnt...

And its cool, just please dont do it again eh? :D

Gizmo356
July 18th, 2006, 02:44
sorry man i deleted my post I hope you forgive me. :(

jman420
July 18th, 2006, 04:08
its all good!

jman420
July 18th, 2006, 09:20
B.U.M.P bumpity bumpbump

jman420
July 19th, 2006, 01:17
nobody wanted to put this on the news forum?? well at least 10 more people downloaded it..

Accordion
July 19th, 2006, 15:35
its on pspu, does that help or not? ha

anyway good work as always

Apoklepz
July 19th, 2006, 17:13
I have accualy modeled the intire town in 3D and rendered off the images, and I will eventualy model a character in 3D and make my own sprites..


Hey Jman, I played it on my PC Luaplayer and it looks promissing...Keep it up. BTW, did you manage to use the Gmax2PSP that I sent you for applying the 3D renders to Lua script?

jman420
July 19th, 2006, 19:46
hey, I looked at the readme for the Gmax2PSP and it was so vauge that I havent even taken the time to install or try to use it.. I will get around to it eventualy though :D but what do you mean 'renders' I just rendered those bg1,1 through 3,5 as a PNG from 3DS and then split it into peices as Lua wont load images larger then 480x272.. I dont think I can use Gmax for much other then verticy rendering

jman420
July 19th, 2006, 20:03
well alright thanks for telling me accordian, I threw a comment on QJ there...

jman420
July 20th, 2006, 18:56
To help out Gizmo (and anyone else) I am going to post the method I used for animation with 5 frames, rather then 2.. its fairly simple, and still fully functional..

also, my updated E's Lua code :D

yaustar
July 20th, 2006, 21:47
Problems: The more frames the animation, the more if statements are used which severely branches your code. This causes (heavy?) performence lost. The other problem is that the number of frames is hard coded into the control code so it isn't flexible enough to handle animations of various lengths.

jman420
July 21st, 2006, 02:47
its flexible, it uses a timer for the time that the button is pressed, therefor, as long as the button is pressed, it will count up untill it is told to reset

it works just fine :D

and the multiple if statements dont slow down the usability, the if statements are just there for when the assigned is done...

Kaiser
July 21st, 2006, 06:30
Coder status is coming I promise you. I'm sure you could be bumped right to PSP Coder status (and skip the LUA stage) considering your other massive project. Its also worth noting all releases should be posted in the submit news section, we're a lot more likely to bump into it. See how fast it was sent to the news page after you made a clone of this thread in Submit News forums?

Anyways keep up the great work Jman!

yaustar
July 21st, 2006, 21:04
its flexible, it uses a timer for the time that the button is pressed, therefor, as long as the button is pressed, it will count up untill it is told to reset

it works just fine :D

and the multiple if statements dont slow down the usability, the if statements are just there for when the assigned is done...
You misunderstood. Here is the code for your animation:


if timerL >= 10 then characterL = playerL2 end

-- change when numbers are hit --

if timerL >= 20 then characterL = playerL3 end

if timerL >= 30 then characterL = playerL4 end

if timerL >= 40 then characterL = playerL5 end

-- change when less then 10 --

if timerL <= 10 then characterL = playerL end

-- other animation directions --

if timerR == 50 then timerR = 0 end
if timerR <= 10 then characterR = playerR end
if timerR >= 10 then characterR = playerR2 end
if timerR >= 20 then characterL = playerR3 end
if timerR >= 30 then characterL = playerR4 end
if timerR >= 40 then characterL = playerR5 end

if timerD == 20 then timerD = 0 end
if timerD <= 10 then characterD = playerD end
if timerD >= 10 then characterD = playerD2 end
if timerD >= 20 then characterL = playerD3 end
if timerD >= 30 then characterL = playerD4 end
if timerD >= 40 then characterL = playerD5 end

if timerU == 20 then timerU = 0 end
if timerU <= 10 then characterU = playerU
if timerU >= 10 then characterU = playerU2 end
if timerU >= 20 then characterL = playerU3 end
if timerU >= 30 then characterL = playerU4 end
if timerU >= 40 then characterL = playerU5 end
Without changing the animation control code (above), how would an extra attack animation that is 3 times long fit in? More if statements? Bad design move.

Currently you have 24 if statements running each loop, that is 24 branches of code and it WILL slow down the framerate (at least it does on complied languages). Now considering that this section of code is just for the player graphic, what happens when we have 20 NPCs on the screen at the same time? Taking the current coding method it would be 20 x 24 more if statements ran each frame. Not good for framerate.

The usability is fine, the performence is what worries me.

HardHat
July 21st, 2006, 23:08
There are two ways to improve it:

move to elseif:

if timerD == 50 then
timerD = 0
elseif timerD <= 10 then
characterD = playerD
elseif timerD <= 20 then
characterD = playerD2
elseif timerD <= 30 then
characterD = playerD3
elseif timerD <= 40 then
characterD = playerD4
else
characterD = playerD5
end

(which improves the number of tests) or of course make it use tables:

earlier (after images are loaded, but before the main while loop):

playerDframe={playerD,playerD2,playerD3,playerD4,p layerD5}

then instead of the list of ifs/elseifs:

if timerD == 50 then timerD = 0 end
characterD = playerDframe[math.floor(timer/10)]

Edit: fixed cut and paste errors.

yaustar
July 21st, 2006, 23:25
I would have done the latter as there would only be two tests per frame per object. One for the time passed and another to reset the current frame in the table if it reaches the last frame.

HardHat
July 21st, 2006, 23:38
I would have done the latter as there would only be two tests per frame per object. One for the time passed and another to reset the current frame in the table if it reaches the last frame.

And as an added bonus, there is less chance of cut and paste errors. Just fixed two more from my example.

jman420
July 22nd, 2006, 00:05
wait, did you copy that exactly? because yeah, thats realy messed up, I didnt mean to move the frame direction changes around..


Edit:
Yeah, that code was realy Funky, the directions werent supposed to change, so I modified it and made all the directions correct... I should have checked it before I posted it eh? :p