Work in Progress

.+* Farm Life *+.

4

was8bit 2021-04-02 05:27 (Edited)

V0.1 collect.... use (A) to load wagon
V0.2 goto big house to buy upgrade
V0.3 added goal progress tracker....
..... store lights turn on when upgrade is available...
V0.4 added PERSIST game save, use little house to save game
.... added level recognition... now just need to add more levels :)
V0.51 beginning ocnversion for multilevel play...

Farm Life 0.48.nx | Open in app
2021-05-05 03:37
Farm Life 0.47.nx | Open in app
2021-05-04 18:51
Farm Life 0.46.nx | Open in app
2021-05-03 18:59
Farm Life 0.45.nx | Open in app
2021-05-03 05:13
Farm Life 0.44.nx | Open in app
2021-04-27 18:22
Farm Life 0.43.nx | Open in app
2021-04-27 15:05
Farm Life 0.42.nx | Open in app
2021-04-27 10:12
Farm Life 0.4.nx | Open in app
2021-04-05 04:26
Farm Life 0.3.nx | Open in app
2021-04-04 05:13
Farm Life 0.3.nx | Open in app
2021-04-04 04:56
Farm Life 0.2.nx | Open in app
2021-04-03 05:40
Farm Life 0.2.nx | Open in app
2021-04-03 05:27
Farm Life 0.1.nx | Open in app
2021-04-02 06:59
Farm Life 0.1.nx | Open in app
2021-04-02 06:42
Farm Life.nx | Open in app
2021-04-02 05:27

G-9 2021-04-02 10:29

Is this based from MyGeekFarm ??


was8bit 2021-04-02 16:29

Not based, but inspired :)


was8bit 2021-04-03 05:34 (Edited)

Player moves faster...

Help text changes specific to where player is...

All upgrades work...


was8bit 2021-04-04 04:58 (Edited)

Need to add auto save and auto reload to allow game to be played where last left off...

Then i can add more levels...


was8bit 2021-04-04 05:16

I added that store lights come on when upgrade is available... i will use this technique for the little house... when progress has been made in the game that should be saved, the lights will come on in the little house, and player can go to the little house to save progress, which will turn the lights off in the little house :)


CubicleHead 2021-04-04 12:25

So cool!


was8bit 2021-04-04 15:16

Thanky :)

Although it isnt probably as cool as Timos farm game... but i thrive on others inspirational ideas :D


was8bit 2021-04-05 04:57

Ok... so i have sketched out level 2... i will finish and post level2 if i get 2 votes from 2 people who want to see a level 2 ;)


G-9 2021-04-05 07:35

Bonjour i wanna see level 2


was8bit 2021-04-05 11:42

Tres bien, merci beaucoup :D

(Thank you Google) ;)


CubicleHead 2021-04-05 14:24

Level 2! Level 2!


was8bit 2021-04-05 17:16 (Edited)

Ok, cool :D.... will start working it :D


CubicleHead 2021-04-05 18:30

Yay! Y(^U^)Y


was8bit 2021-04-06 16:54

... working on it :)


was8bit 2021-04-09 06:09 (Edited)

I am having trouble rewriting my code to handle multiple levels... of course i am often too tired to work it out.. be patient, i will eventually get er done ;)


was8bit 2021-04-17 04:09 (Edited)

I have been working/busy 7days a week, 10-12 hrs a day of late.. so my brains are not cooperating when it comes to reworking this code.. i havent't forgot and will get er done as soon as i get a day off :)

The second level is graphically planned and made, just gotta get the code rearranged ...


CubicleHead 2021-04-17 18:28

Cool :)


SP4CEBAR 2021-04-25 16:47 (Edited)

I really like this game
Also, I'd like to report a bug which, when it occurs, could make the game unbeatable:
when walking trough the fence (to the animals) it sometimes glitches to a neighboring cell, which could lead to the animals escaping and blocking the road. I hope you'd be able to fix it


was8bit 2021-04-26 05:13

Thanky :)

Ah, yes, i myself haven't been able to repeat this glitch, but a personal tester discovered the same glitch, but couldn't tell me what they were doing differently than me that could cause it...

Regardless of what is causing it, i have an idea that should prevent it from happening...

If i wasnt sooooo dang-nabitt busy lately with work and family and such, i would have the next level up already... but the bug fix i should be able to get that done by sometime tomorrow ... thanks from the feedback on the bug :)


SP4CEBAR 2021-04-26 06:46

Good luck fixing it :)


was8bit 2021-04-27 10:13 (Edited)

Ok, so i "think" this fix should be good, so see if you can reproduce the bug and let me know... thanks :D


SP4CEBAR 2021-04-27 14:57

Wow, I managed to clone the player by doing some random movement at the fence gate, that's a funny bug


was8bit 2021-04-27 15:01

Wowzers! Ok, thanks much for the feedback, let me take a look at it....


SP4CEBAR 2021-04-27 15:02

By doing some more random movement at the fence gate, the gate moved one pixel down and turned black


SP4CEBAR 2021-04-27 15:09

Loading a cart also has a chance of duplicating the player


was8bit 2021-04-27 15:11

See how v0.43 works... i appreciate your testing as i cannot reproduce these bugs, dont't know why... i try but i cant get these bugs... so your feedback os greatly appreciated :D


was8bit 2021-04-27 15:13

... erp on the cart bug... i gotta do a quick chore, but post what u find and i will pick them up later today to fix :)


SP4CEBAR 2021-04-27 15:18 (Edited)

It looks like these bugs only occur at specific times (like when the frame is drawn or something like that, or if timer or raster functions are used somewhere)
It sometimes happens when the player just walks trough the fence gate, but it's more likely to happen when the player goes trough a fence gate a lot
Either way, good luck debugging :)


SP4CEBAR 2021-04-27 15:20 (Edited)

In this version the fence gates disappear as you walk trough them


was8bit 2021-04-27 18:03

Egads.... ok... I will look at this later today when i won’t be rushed ...


was8bit 2021-04-27 18:24

Ok.. V0.44 tested and hopefully debugged :)


SP4CEBAR 2021-04-28 20:22

It looks like the player duplication bug is gone, but by repeatedly going trough fence gates, they can still move to a neighboring cell (when that happens the fence gate usually turns black until the player goes trough it again)


was8bit 2021-04-29 04:00

Hmmm.... thanks so much for all the details around the issue... I will do some more research on it....


was8bit 2021-05-03 05:13

Ok, i hope this is fixed for sure now...


SP4CEBAR 2021-05-03 08:46 (Edited)

Although it seems to happen less often, it's still possible for the main fence gate to glitch one pixel down and turn black
Also, when going trough the fence gate repeatedly, at one point the player disappeared

Good luck with debugging


was8bit 2021-05-03 11:23

Are you using an apple device or a windows computer??


was8bit 2021-05-03 19:00

V0.46.... ???


SP4CEBAR 2021-05-03 19:06

I'm using an IOS iPad 6


SP4CEBAR 2021-05-03 19:12

Unfortunately both the fence moving a cell down and the player disappearing bugs are still there
The fence moving down bug seems to be a timing thing: by repeatedly going trough the fence, it sometimes happens almost immediately, but at other times it takes a while before it happens


CubicleHead 2021-05-03 20:49

It's happening to me too
I'm iOS 9


was8bit 2021-05-03 23:59

This is making me crazy, as i can NOT get any errors no matter how hard i try...


was8bit 2021-05-04 01:36

OK, i made an EXTREME test... it forces 1 whole second wait times at steps in the movement code...

NOW see if it makes any errors ....


was8bit 2021-05-04 01:36

OK, i made an EXTREME test... it forces 1 whole second wait times at steps in the movement code...

NOW see if it makes any errors ....


was8bit 2021-05-04 01:37

OK, i made an EXTREME test... it forces 1 whole second wait times at steps in the movement code...

NOW see if it makes any errors ....


was8bit 2021-05-04 01:37

OK, i made an EXTREME test... it forces 1 whole second wait times at steps in the movement code...

NOW see if it makes any errors ....


SP4CEBAR 2021-05-04 10:51 (Edited)

I think I can see what's happening here
1. The player steps in the fence
2. The player steps out of the fence
3. The fence responds to the user input of the player and moves to the joystick direction (which is down in this case)
I think a part of the game sometimes has an outdated location of the player, which results in it seeing the location of the fence as the player location, and so it moves the cell the fence is in
The palette changing to black is probably the fence getting palette of the the player


SP4CEBAR 2021-05-04 10:55

That's the risk of using bg cells as sprites


SP4CEBAR 2021-05-04 10:59

Good luck with debugging


CubicleHead 2021-05-04 11:43

just to let you know if i go to the gate into the farm and go up through it until i am one cell above it and then i wait for it to reappear then i just step down and the gate moves and turns black
not sure if that will help


was8bit 2021-05-04 12:36

Ok, so something isnt right, because it does NOT behave like that when i run it...


was8bit 2021-05-04 12:43

Ok, wait, i got it to do that...

In my tests i go up 2 squares before going back down... this this case the system recovers ok..

But when i go up only one square, then go down right away, i get the black fence you mentioned...

NOW that i can reproduce the error, i can actually properly investigate it and fix it.. THANKS SO MUCH for your patient testing :D


SP4CEBAR 2021-05-04 14:13

No problem, good luck with further debugging it


was8bit 2021-05-04 18:57

Ah.ha.... fixed... IGATE was not global, and so IGATE was bring reset to 0 each time the SUB was called... that was the problem all along, and you noticed i not only added TRACE reports, but also added different frequencies in each IF statement, so i could see and hear WHERE the code was being executed.... that immediately let me know the conditional check for IF IGATE=1 was never beinf executed, even after being set... so that immediately let me know IGATE perhapes wasnt global, and it wasnt... ;)


was8bit 2021-05-04 18:57

Ah.ha.... fixed... IGATE was not global, and so IGATE was bring reset to 0 each time the SUB was called... that was the problem all along, and you noticed i not only added TRACE reports, but also added different frequencies in each IF statement, so i could see and hear WHERE the code was being executed.... that immediately let me know the conditional check for IF IGATE=1 was never beinf executed, even after being set... so that immediately let me know IGATE perhapes wasnt global, and it wasnt... ;)


was8bit 2021-05-04 18:57

Ah.ha.... fixed... IGATE was not global, and so IGATE was bring reset to 0 each time the SUB was called... that was the problem all along, and you noticed i not only added TRACE reports, but also added different frequencies in each IF statement, so i could see and hear WHERE the code was being executed.... that immediately let me know the conditional check for IF IGATE=1 was never beinf executed, even after being set... so that immediately let me know IGATE perhapes wasnt global, and it wasnt... ;)


was8bit 2021-05-04 18:57 (Edited)

Ah.ha.... fixed... IGATE was not global, and so IGATE was being reset to 0 each time the SUB was called... that was the problem all along, and you noticed i not only added TRACE reports, but also added different frequencies in each IF statement, so i could see and hear WHERE the code was being executed.... that immediately let me know the conditional check for IF IGATE=1 was never being executed, even after being set... so that immediately let me know IGATE perhapes wasnt global, and it wasnt... ;)


was8bit 2021-05-04 18:58 (Edited)

So, test just to ease my mind :)

... and so i can start working on level 2....


SP4CEBAR 2021-05-04 21:26 (Edited)

I don't know how, but...

The same bug still happens sometimes


CubicleHead 2021-05-04 22:11

yeah :( me too


CubicleHead 2021-05-04 22:15

to make it happen on the gate into the farm i just go up through the gate and then the very next frame go back down into the gate and the gate goes below me and turns black


CubicleHead 2021-05-04 22:23

it only works one way and when i do it the debug shows this:

when i go into the gate:
>17 2 0
17 2 1
when i leave the gate:
>17 0 1
17 0 0
the next frame when i go back down into the gate:
>2 0 0
2 0 0

idk if this'll help


was8bit 2021-05-05 02:00

Urg....


was8bit 2021-05-05 03:48

Ok, so i reworked the code, and discovered that i also could reproduce the error in the left right as well as up down... but i realized that the error ONLY occurred when going DOWN, or going LEFT.... now look at my code...

IF RIGHT(0) AND NOT UD THEN CALL DOPLAYER(X,Y,1,0)
IF LEFT(0) AND NOT UD THEN CALL DOPLAYER(X,Y,-1,0)
IF UP(0) AND NOT LR THEN CALL DOPLAYER(X,Y,0,-1)
IF DOWN(0) AND NOT LR THEN CALL DOPLAYER(X,Y,0,1)

Also realize that the background SCANS each cell one at a time, and for example when moving a character to the right, you have to account for the fact that you should only move a character ONCE until the whole background gets scanned....

Now look at the new code...

IF RIGHT(0) AND NOT UD AND IMOVE=0 THEN CALL DOPLAYER(X,Y,1,0)
IF LEFT(0) AND NOT UD AND IMOVE=0 THEN CALL DOPLAYER(X,Y,-1,0)
IF UP(0) AND NOT LR AND IMOVE=0 THEN CALL DOPLAYER(X,Y,0,-1)
IF DOWN(0) AND NOT LR AND IMOVE=0 THEN CALL DOPLAYER(X,Y,0,1)

If the character is moved, the SUB sets IMOVE=1 and is not reset until the background scan is completely done...

Now, before this change, if you go RIGHT then immediately LEFT, or UP then DOWN immediately, the code attempts to move the character twice before the scan is finished... which will almost always mess things up unexpectedly....

.... so i am confident this bug is finally squashed!


was8bit 2021-05-05 04:01 (Edited)

A similar problem occurs with using background to hold game data for something like Space Invaders... with the scan X=0 to 19 and IF CELL.C(X,Y)=ALIEN THEN MOVEALIENRIGHT... will actualy cause the alien to jump from x=0 to x=19 in one go because it gets moved each scan of x, so it gets moved 20 spaces before the scan is finished with WAIT VBL...

the trick is to create a dummy alien for right and down movement, and when the dummy alien is scanned, just replace it with a real alien as apposed to moving it, and the end result will look proper...


was8bit 2021-05-05 04:04

So, no matter how one avoids it, when using a background as game data, and scanning and processing each cell in the background ... each object should be processed only once per scan, and when scan is done, execute the WAIT VBL and LOOP

I will remember this bug forever ! ! !


SP4CEBAR 2021-05-05 08:21 (Edited)

Nice,
I usually make a bug memorial (comment) in my code whenever I've solved a big bug


SP4CEBAR 2021-05-05 08:36 (Edited)

It's possible to make a movement function without if statements using something like this:

ADD X,RIGHT(0)*(X<128)-LEFT(0)*(X>-8)
ADD Y,DOWN(0)*(Y<96)-UP(0)*(Y>-12)

Or this:

DX=LEFT(0)-RIGHT(0)
DY=UP(0)-DOWN(0)
ADD X,DX
ADD Y,DY


was8bit 2021-05-05 10:18

Very clever code :)


was8bit 2021-05-05 10:44 (Edited)

Technically the bug was a product of tired brains... my first oversight was to not make a variable global that was only being used inside a SUB, but needed to keep its value between calls... and second was my forgetfulness of the scanning issue, letting an object on the background to get unknowingly processed twice in the same scan...

Easy fixes once i figured out what the issue was.... in original lowres my biggest issue was typos of variable names and original lowres allowed the code to run with unassigned variables.... i could almost NEVER find those... fortunately this issue was fixed for NX ;)


CubicleHead 2021-05-05 11:48

Yay! It works!


SP4CEBAR 2021-05-05 12:27 (Edited)

Indeed, it works now


was8bit 2021-05-05 14:57

Yeehaw! :D


was8bit 2021-05-05 14:58

Now I can work on transferring this code onto a multilevel form, and then get level 2 up and running :)


CubicleHead 2021-05-05 19:11

Weeeeeeeee!


SP4CEBAR 2021-05-05 21:11

Awesome!


CubicleHead 2021-05-09 00:09

OoooOOOOoooooOOOOo!


was8bit 2021-05-09 03:11

Level 2 will be gathering straw into a bailer, which when full makes a bale of hay, which must be taken to a wagon for delivery...

I have a few ideas for level 3.... but if you have something you would like to see i might do that next.. (rememb that this farm is old fashioned and you are just a hired hand learning as you go... nothing fancy, simple mechanical machines... no gas powered motors or electricity or such)


Log in to reply.