How To

I have two questions

0

GAMELEGEND 2020-04-23 21:59

1st question why did the CPU number go down when i added more factories

2nd question there has to be a better way to animate these right

Sandbox.nx | Open in app
2020-04-23 21:59

was8bit 2020-04-24 03:52

LOOPS are CPU intensive... DOUBLE LOOPS are even more so.... your double loop iterates everything inside 300 times... so 2things is 600, 10 things is 10,000....: etc..


was8bit 2020-04-24 03:53

Here is a different approach....


was8bit 2020-04-24 04:00 (Edited)

My approach is based on this....

https://lowresnx.inutilis.com/topic.php?id=566


was8bit 2020-04-24 04:04 (Edited)

Your approach is OK, i did it here...

https://lowresnx.inutilis.com/topic.php?id=296

However you cannot do lots of fancy, you must limit the amount of processing as much as possible..l my game, if you noticed, is at MAX and so sometimes behaves oddly...


GAMELEGEND 2020-04-24 04:34

Thanks
All i have to do is learn COPY the rest of the way and i will fully understand this or understand this 98% of the way


was8bit 2020-04-24 04:53 (Edited)

$8000 is where the CHARACTER graphics are stored in active game memory... at game start, NX copies your char graphics from data file#2 into active memory $8000

Each character takes 16 bits, hence COPY must copy 16 bits, and also each character is placed memory 16 bits at a time, so char 0 is stored in memory $8000+0*16, char 1 @ $8000+1*16,... char 20 @ $8000+20*16... char 100 @ $8000+100*16...


was8bit 2020-04-24 04:54

Take a look at the new background, it is different.. i created "placeholders" where each different animation will be... actual images will get copied over top the placeholders during the game...


was8bit 2020-04-24 04:55

MANI1=5
MANI2=6
MANI3=7
TANI1=0
TANI2=0
TANI3=0
IANI1=0
IANI2=1
IANI3=2

MANI1-3 determines how QUICKLY the animations changes the images... smaller # is faster, bigger # is slower


was8bit 2020-04-24 04:56

TANI1=(TANI1+1) MOD MANI1

Is what tracks the time between frames


was8bit 2020-04-24 04:57

This changes the graphics/frame...

IF TANI1=0 THEN
ADD IANI1,1,0 TO 4
COPY MADD+(65+IANI1)*16,16 TO MADD+64*16
END IF


was8bit 2020-04-24 04:59

You have 5 graphic frames (all 3 share the same graphics)...so

ADD IANI1,1,0 TO 4

Steps thru one frame in order


was8bit 2020-04-24 05:01

COPY MADD+(65+IANI1)*16,16 TO MADD+64*16

(65+IANI) yields chars 65 thru 69... these are where i moved your actual graphics


was8bit 2020-04-24 05:06 (Edited)

64*16
80*16
96*16

Is the location of the 3 placeholders...

In your CHAR DESIGNER. These all stay seperated where you see them

In actual game memory as the game runs, COPY moves copies of graphic data around...

Remember, BG 0, BG 1 do not actually hold graphic data, just a reference# to the CHAR# in game memory... so COPY here doesnt really effect BG 1 or BG 0, it is just a way to trick NX and creating the effect because WE are putting different graphic data into the Char Game memory ;)


was8bit 2020-04-24 05:10

It took me awhile to wrap my mind around this... so dont worry if it feels abit fuzzy right now :)


GAMELEGEND 2020-04-24 05:10 (Edited)

It going to take me a while to read all this XD
And then wrap my head around it


was8bit 2020-04-24 05:11

Take your time :)


Timo 2020-04-24 06:12

One note: a character occupies 16 bytes, not bits.
1 byte = 8 bits


was8bit 2020-04-24 07:12

Ah yes, i got abit sloppy, thanks :)


Log in to reply.