CodeWalrus

Development => Calculators => Calc Projects, Programming & Tutorials => Topic started by: E37 on December 05, 2016, 08:11:21 pm

Title: E37's projects
Post by: E37 on December 05, 2016, 08:11:21 pm
I tend to make little projects every now and then, and none of them really deserve their own thread. I guess I'll put them all here.
They aren't usually much, so feel free to ignore this thread unless you are really bored and want some dumb distraction for a little while.

(click to show/hide)

I will add more when I feel like typing out how to use them.
Title: Re: E37's projects
Post by: DJ Omnimaga on December 06, 2016, 08:30:35 am
I will try this when I have a chance. You should post a screenshot :)
Title: Re: E37's projects
Post by: E37 on January 07, 2017, 06:01:48 pm
I have been working on a game recently. It is a caving game where you can place buildings, teleport in 'miners' and drilling units. You start out with a small area discovered and can uncover more caves.
Right now, I just use the cursor to destroy walls, but eventually the units will. The game looks a lot better on an actual calc. I used the A* pathfinding algorithm (the only good example in the screenshot is when the unit went around some rubble which would have been a slower path)

I am debating whether to make it turn based because the whenever a unit pathfinds, it can lag up to a second.

After the program exits, pressing the ON key shows "X=7.2E-128 Y=7.2E-128" in small font at the bottom left corner of the screen. It doesn't appear to be harmful but I can't figure what is causing it. I am sure the program causes it.

Any thoughts?
Title: Re: E37's projects
Post by: p4nix on January 07, 2017, 06:20:49 pm
Looks very good, too bad I don't have a TI calculator. Maybe you can only calculate a few parts of the A* algorithm using something like interrupts or polling...
In which language did you program this?
Title: Re: E37's projects
Post by: E37 on January 07, 2017, 06:22:16 pm
Looks very good, too bad I don't have a TI calculator. Maybe you can only calculate a few parts of the A* algorithm using something like interrupts or polling...
In which language did you program this?

That might be possible, but The trouble starts when there are 5+ of them all wanting to pathfind.
It is in Axe.
Title: Re: E37's projects
Post by: E37 on January 08, 2017, 04:30:20 pm
(click to show/hide)

(click to show/hide)

(click to show/hide)

(click to show/hide)

(click to show/hide)

I will add more when I feel like typing out how to use them.

I am too lazy to make screenshots. If you want one, ask me.
Title: Re: E37's projects
Post by: p4nix on January 08, 2017, 10:20:50 pm
Feels bad not having a calculator which can run Axe ;) Keep your good work up tho, from the descriptions it sounds very interesting. Could you still add some eyecandy (screenshots)?
Title: Re: E37's projects
Post by: p2 on January 08, 2017, 11:04:06 pm
After the program exits, pressing the ON key shows "X=7.2E-128 Y=7.2E-128" in small font at the bottom left corner of the screen. It doesn't appear to be harmful but I can't figure what is causing it. I am sure the program causes it.

Any thoughts?
sounds like its displaying (or at least trying to) the cursor position. That means you have to reset the game from graph screen to main text screen (don't ask me how).
Still you should get a problem as it seems you have altered the part of memory where the cursor position is saved. The address for that should be somewhere in TI Wiki.
Title: Re: E37's projects
Post by: E37 on January 10, 2017, 06:29:14 pm
That makes sense!  :D
I'm testing it now. There is no point in the os that does it normally that I can think of though...

I have fixed it!
It turns out that if you use L2 (statVars) as a 756b buffer, you need to 0 it before you quit.
Title: Re: E37's projects
Post by: p2 on January 11, 2017, 10:46:00 am
Glad to hear :)
Was that already your last known bug, or are there others? ^^
Title: Re: E37's projects
Post by: E37 on January 12, 2017, 06:22:26 pm
They are always more. Killing one causes 3 more to pop up each more bizarre than the last.  ;)

I hope to upload some more screenies later today,.
Title: Re: E37's projects
Post by: kotu on January 12, 2017, 06:27:17 pm
you'll have to research learning magic spells
Title: Re: E37's projects
Post by: p2 on January 13, 2017, 08:45:29 am
They are always more. Killing one causes 3 more to pop up each more bizarre than the last.  ;)

I hope to upload some more screenies later today,.
/me is waiting for his eye candy (https://codewalr.us/walrusirc/smileys/kittyface.gif)

sorry if I'm being pushy >.<
Title: Re: E37's projects
Post by: E37 on January 13, 2017, 06:20:44 pm
They are always more. Killing one causes 3 more to pop up each more bizarre than the last.  ;)

I hope to upload some more screenies later today,.
/me is waiting for his eye candy (https://codewalr.us/walrusirc/smileys/kittyface.gif)

sorry if I'm being pushy >.<
Not at all  ;)
I tried to introduce more features and seriously broke things...
Title: Re: E37's projects
Post by: E37 on January 15, 2017, 09:37:55 pm
Well... I finally got it working! (and added a load of new things)
I increased the map size, made it turn based, cut the average pathfinding time in half, vastly improved the greyscale (greylib), improved the worker's ai, added 2 new vehicles, made it so the units (not the user) have to drill walls, fixed all the memory leaks and completed some general optimizations!
Don't worry, there will be screenshots!

Planned features:
4 more vehicles
a way to remove units once they have been created
the ability to create buildings
some enemies
better control options
more buildings (all the buildings that currently exist are in the screenshot)
Title: Re: E37's projects
Post by: p2 on January 15, 2017, 10:29:16 pm
Well THHAT'S what I call an update! :D Really nice work, @E37  :thumbsup:
You should probably write a separate post about your path finding algorithm as others may find that useful :)
Title: Re: E37's projects
Post by: E37 on January 15, 2017, 10:38:27 pm
Subroutine: AStar
CALL   PushNode(OpenStack,StartingX,StartingY,0,0,0)   // this sets the starting node and sets it's distance to the goal to 0. (that value doesn't matter it can really be anything since the x and y cords. determine if the goal has been found) I set its parent's x and y to 0 so when I am calculating the path at the end, I know that it is the starting node.

While ("tmpOpen" is not empty){
    If (!PathFound){
    CALL    Calc1Node       //this doesn't really need to be a subroutine but it makes it easier to read
    }Else{
    Return    //Sucess! Each node points to the previous one in the path so all you need to do is return up the stack starting with the node on the goal
    }
}
Return          //Fail! no paths exist to the target!

Subroutine: Calc1Node
Find the node that is the closest to the target on the open stack and pop it off the stack. You should ignore the node if it is on an impassible tile or already exists - It is perfectly fine to only add a couple nodes. You will only add 8 nodes on the first tile as every other tile will be adjacent to the tile that called it.
Calculate the 8 nodes nearest to it and their distance from the target (I used sqrt(abs(Y-TargetX)2+abs(Y-TargetY)2)+ValueOfTile  ValueOfTile is how much movement is needed to cross this tile - higher numbers are harder to cross!)
Push each of the nodes onto the open stack. Make sure to have them include their parent node's location! However if the node is on the goal tile, push it to the closed stack and set PathFound to true.
Push the node that was evaluated (the one that was popped off when this was called) onto the closed stack
Return

PushNode
/*
Node Structure
Toal: 6 bytes
1b: NodeX
1b: NodeY
2b: Distance to goal
1b: parentX
1b: parentY
*/
Pushes the node to either the open or closed stack. I inserted memory on the end of the appv to do the least amout of shifting. I also refound the pointers for both stacks in case they moved.
Return

PopNode
//pops a 6 byte node off the open stack. See node structure...
I used deleteMem once the data was retrieved.
I also refound the pointers for both stacks in case they moved.
Return

Define: "tmpOpen"       //list of nodes left to be checked
Define: "tmpClosed"    //list of nodes that have already been checked

Note: this returns the path form finish to start. You will want to make the goal pathfind to the unit!



I also tacked it onto the end of my huge Axe post!
Title: Re: E37's projects
Post by: DJ Omnimaga on January 16, 2017, 05:54:13 am
Darn this mining/drilling game looks very nice! I hope you can keep the speed as high as you can. Will there be specific objectives for each stage, such as having to finish mining a cave in a certain amount of time, then a different objective for the next stage and so on, or will the difficulty increase be mostly based on the complexity of each map?

Also your above post about pathfinding could definitively be a nice new topic.
Title: Re: E37's projects
Post by: E37 on January 17, 2017, 01:21:16 am
I'm a bit embarrassed, but I don't have a specific goal in mind. It may be on a timer (due to air consumption) or be against enemies like rock creatures. It could be something totally different.

Any suggestions?
Title: Re: E37's projects
Post by: 123outerme on January 17, 2017, 01:22:40 am
I'm a bit embarrassed, but I don't have a specific goal in mind. It may be on a timer (due to air consumption) or be against enemies like rock creatures. It could be something totally different.

Any suggestions?
Maybe a meter like "fuel" or "fatigue"? When you do something extremely taxing, the meter goes down more than it usually does, or something along those lines.
Title: Re: E37's projects
Post by: SiphonicSugar on January 17, 2017, 01:24:48 am
E37, how do you get the will, inspiration, and motivation to do this? :P
Title: Re: E37's projects
Post by: E37 on January 17, 2017, 09:24:14 pm
I'm a bit embarrassed, but I don't have a specific goal in mind. It may be on a timer (due to air consumption) or be against enemies like rock creatures. It could be something totally different.

Any suggestions?
Maybe a meter like "fuel" or "fatigue"? When you do something extremely taxing, the meter goes down more than it usually does, or something along those lines.
Sounds interesting. I may have the crystals expendable for something like to refresh air or something.  I still haven't made up my mind.

E37, how do you get the will, inspiration, and motivation to do this? :P
Pretty simple. I program mostly for myself. I don't worry about creating a presentable project, and make whatever comes to my mind. If I am tired of a project, I stop working on it and start another. Inspiration? Whatever comes to mind. I never plan a program out. It evolves as I work on it.
Title: Re: E37's projects
Post by: E37 on January 18, 2017, 09:06:27 pm
Well... I am running out of ram. :P
Some of it needs to be in an app...
On the bright side, I added 2 new vehicles - Hover Scout and Loader Dozer!
I kicked it up to 15MHz so the framerate is much nicer. I also limited the framerate so that the game always runs smoothly.
You can also make buildings! I added a couple new buildings as well.
Added a new class of vehicle - lazer drill. (my other 2 were collector and drill)
Minor improvements to ai.
I will be approaching a beta release soon.

Sound cool?
Title: Re: E37's projects
Post by: p2 on January 19, 2017, 09:35:38 am
Sound cool?
:walrii:  :thumbsup:

maybe you could move parts like the map into appvars to reduce the size...? (ever map except the one that is currently in use - probably split the map for that purpose)
buuut in your project map size will change almost nothing... :/
Title: Re: E37's projects
Post by: E37 on January 19, 2017, 05:48:16 pm
Sound cool?
:walrii:  :thumbsup:

maybe you could move parts like the map into appvars to reduce the size...? (ever map except the one that is currently in use - probably split the map for that purpose)
buuut in your project map size will change almost nothing... :/
I already did that. It saved 1000b. I also set it up to allow easy loading of different maps.
I am moving all the really heavy Ai to a separate appv. The main program will be an app, and it will run the appv which will save 6000b!

Any ideas for new units/ mechanics?
Title: Re: E37's projects
Post by: p2 on January 20, 2017, 09:10:19 am
it's about drilling a huge cave, right?
do you know the old bomberman games...? ;D
add bombs (one kind that is falling down, one kind that sticks to its pos) a well as lava explosive blocks in the wall that go off and kill you if you drill into them (traps) :)
Title: Re: E37's projects
Post by: E37 on January 20, 2017, 01:19:11 pm
it's about drilling a huge cave, right?
do you know the old bomberman games...? ;D
add bombs (one kind that is falling down, one kind that sticks to its pos) a well as lava explosive blocks in the wall that go off and kill you if you drill into them (traps) :)
Oops... Looks like I wasn't clear on the purpose of the game. It is a top-down strategy game. You don't have a specific character. It is more about building a base, controlling workers and getting bigger and better vehicles to drill with.
Title: Re: E37's projects
Post by: E37 on January 24, 2017, 06:52:51 pm
Update:
Added 3 new vehicles (they don't do anything yet)
Redid AI structure -saved 1000b
Redid unit spawning (when you buy a new unit) -saved 1000b
Added a title screen!
Added level selection!

I was thinking of adding and 'epic' version of each vehicle. It would be unlockable throughout the game for going above and beyond or reaching a secret area. They would be like the normal version of the vehicle but free to summon (the limit is 1 though)  and have a special upgrade. What do you think?
Title: Re: E37's projects
Post by: p2 on January 25, 2017, 12:39:38 pm
I think it might be hard doing them, thinking about the tiles for the monochrome calc.
I'd rather go for general updates like in CookieClicker (all drills word 10% faster, all units move 15% faster, ...)
whats the general target of the game?

there was once a game where you had a special amount of oxigen (trappedo on a planet) and had to build stuff like robots and s*** to mine minerals and stuff to build a rocket and escape.
(how much is mined? % of how far you are in the game, also time countdown, the oxigen)
what is your game about? :)
Title: Re: E37's projects
Post by: E37 on January 25, 2017, 09:33:39 pm
The story is you are the captain of an exploration ship in space. Your mission is to discover new planets for mining. Your ship is sucked through a wormhole and is badly damaged. You need the crystals on the planet to restore power and the ore to repair the ship. The ship remains in orbit, while units are teleported down to the planet. (There is a crystal cost to power the ship's teleporter) There will be several dangers including hungry rock monsters and crystal draining slugs. Landslides and a depleting oxygen supply are the natural hazards.

I have made 10 out of 20 levels so far. Some levels can be completed in under 10 minutes and others take an hour to beat. The levels are also not linear. Sometimes you can pick between 3 levels and other times you are forced to complete one. Of course you can go back and beat the levels you skip.

It takes so long to compile! I timed it once and to recompile all the parts of it is over two minutes! Thankfully I only have to recompile small parts of it to make a change.

Note that I am not used to the controls. It is fairly easy to use. I also used god mode on the first couple levels to show the level unlocking.
Title: Re: E37's projects
Post by: DJ Omnimaga on January 26, 2017, 02:47:54 am
Ooh I like the premise and hazards ideas. Also nice screenshot :)
Title: Re: E37's projects
Post by: E37 on January 30, 2017, 01:42:09 pm
It's been a little while since I last posted.
Here's what's been accomplished:
Since the game can get pretty long (over two hours on longer levels) I added a fast forward option. It is nothing more than frameskip but it works.
I redid the worker's ai. It is now much easier to control.
Press Alpha to view a unit description.
Cut off another 1000 bytes from the units.
Added Rock Monsters (currently don't do anything)
Finalized the new units.
Did some general bugfixes.
Greatly improved the driller and clearer ai.
Did some fixes to the menu to make it much faster.

Still todo:
Finish rock monsters and giant slugs
Add level descriptions
Add the remaining levels
Add unit descriptions
Redo the level selection screen
Compress the pathfinding result some more?


I am worried that the game is a little boring right now. Hopefully new hazards will liven things up a little.
Title: Re: E37's projects
Post by: p2 on January 31, 2017, 10:03:24 am
your post looks like a poem O.O

yay, nice update, especially the fast forward and monsters ^.^
Really nice update man!!  :thumbsup:
Title: Re: E37's projects
Post by: E37 on February 02, 2017, 09:40:42 pm
I am working on redoing the internal structure of the game. I have reduced the total number of tiles but have increased the complexity of the world. There are 20 tiles currently. However, there are 10 buildings, 8 walls, 12 passable tiles, and 5 more tiles have special variants. Want to guess how I did it? (each tile is one byte and no byte has a value above 20)
There is also a load of new things I am adding (and have added): multi-tile buildings, collapsing walls, units can work together to drill walls, animated rubble clearing, eroding lava, new possibilities for maps (like the level can start with units already out on the field), smooth scrolling, the ability to drag-select, the ability to select tiles, some buildings now require power to work and roads now light up when they are powered, some new walls, and several more units.
Currently the framerate is 20x what is was before, but I'll see how long that lasts.
Title: Re: E37's projects
Post by: DJ Omnimaga on February 03, 2017, 01:06:11 am
Regarding the 2 hours per game, you might definitively want to fix that, as many people might indeed get bored. Maybe put it in fast forward mode all the time or change the game mechanics so that games don't last more than an hour (even 40 minutes for a Starcraft II game is considered long, but not uncommon). Just make sure that if you increase the speed that it won't get impossible to win, though. Maybe have speed settings like in Starcraft? (so novice players can take their time in early levels)

Good to see progress by the way :)
Title: Re: E37's projects
Post by: E37 on February 03, 2017, 01:37:43 am
Regarding the 2 hours per game, you might definitively want to fix that, as many people might indeed get bored. Maybe put it in fast forward mode all the time or change the game mechanics so that games don't last more than an hour (even 40 minutes for a Starcraft II game is considered long, but not uncommon). Just make sure that if you increase the speed that it won't get impossible to win, though. Maybe have speed settings like in Starcraft? (so novice players can take their time in early levels)

Good to see progress by the way :)

I definitely agree.
I am really thinking about making it real time again instead of turn based. That would make the average level closer to 30 minutes. The only problem is that there is a .5-1 second pause where the game freezes when a unit pathfinds. (It is much more noticeable for longer distances and almost unnoticeable for less than 5 tiles) I am working on optimizing that code as much as possible, but it may have to be accepted as-is.

Since the pathfinding is generally pretty simple, I may have the units try to just head in the general direction, and essentially create the path as they go along. (and using the normal algorithm if they get stuck) That would have no lag and take up less space in storage - but the path would be less optimized.  :-\
Title: Re: E37's projects
Post by: p2 on February 05, 2017, 06:52:23 pm
I guess the paths aren't that long anyways so a little less optimised paths wouldn't be that bad. Also I like the idea of making it realtime :)

Maybe even 2 different modes, one realtime and one rounds-based? :)

As always: nice update ;D
Title: Re: E37's projects
Post by: E37 on February 07, 2017, 12:31:16 am
I will definitely add the different modes. I’m dropping 83+ support. It really needed 15MHz mode to function in the first place, and I am mucking around with page swapping (using pages the 83+ doesn’t have). It is going together well so far.
Here are my options for pathfinding: I need to pick 2, one main one and one as a backup (slower) for when the first (faster) fails.
AStar1: the one I am currently using. It always finds a path if possible. It is the slowest.
AStar2: A slight modification of AStar1 it does less searching and is decently faster, but it takes longer if it runs into a dead end. (1 in 10 cases)
AStar3: Quite a bit faster. It fails when it hits a dead end. (about 1 in 10 cases)
AStar4: Basically instant. It fails when the best path takes any serious turns. (about 1 in 3 cases)
Any opinions on which two?
Title: Re: E37's projects
Post by: p2 on February 07, 2017, 09:56:13 am
option 2: speed losses are acceptable, but stuck or lost mobs are terible D:
Title: Re: E37's projects
Post by: E37 on February 07, 2017, 08:59:02 pm
option 2: speed losses are acceptable, but stuck or lost mobs are terible D:
I am using 2 different ones. One can fail (because the backup will pick up)
Title: Re: E37's projects
Post by: WholeWheatBagels on February 07, 2017, 09:34:51 pm
AStar3: Quite a bit faster. It fails when it hits a dead end. (about 1 in 10 cases)

Fails as in how?

I'd say A*2 then A*1, but I'd go with A*3 as second if failing doesn't like crash the whole program or something.
Title: Re: E37's projects
Post by: DJ Omnimaga on February 07, 2017, 11:53:53 pm
I would go with 2 and 3, whichever order is the fastest. 4 is a bit too much like Warcraft II where pathfinding is almost non-existent, but 1 might be overkill for a calc, plus in Starcraft I was kinda annoyed when some units kept moving back and forth forever because they couldn't find the entrance to something.
Title: Re: E37's projects
Post by: E37 on February 08, 2017, 11:24:29 pm
I would go with 2 and 3, whichever order is the fastest. 4 is a bit too much like Warcraft II where pathfinding is almost non-existent, but 1 might be overkill for a calc, plus in Starcraft I was kinda annoyed when some units kept moving back and forth forever because they couldn't find the entrance to something.
The pathfinding will go like this: first it will try the fast algorithm which can fail. If it fails, It must start all over with the algorithm that is guaranteed to succeed. The units will always find a path to the target (if it exists)
I have finished with most of the gutting of the internals. The framerate is definitely faster. (1000 frames in 23 seconds = 43.5 fps!)
I have dropped 83+ support. It already needed 15MHz mode to have a decent framerate, so it was basically unplayable on an 83+ anyway.
The game is back to real-time again!
I have seen some of the weirdest bugs... I had a building that was bugged. It didn't appear to affect anything. When I 'fixed' it though, it crashed!  :-\
There were plenty of derp moments also. I figured out that the code doesn't work if you set the data pointers to 0!  O.O You can't return if you have overwritten where it stores the return address! In order for code to work, it can't be commented out! You apparently can't find a file if the VAT doesn't exist!

There is something about Wednesdays... I always get more done on Wednesdays than two other days... even though I spend the same amount of time each day.  ???

I promise there will be screenies soonish.
Title: Re: E37's projects
Post by: DJ Omnimaga on February 11, 2017, 04:57:15 am
Wow, 43.5 FPS is absolutely impressive. O.O. Good luck squashing those bugs
Title: Re: E37's projects
Post by: p2 on February 13, 2017, 11:43:01 am
Yep, impressive framerate. Also it should make a fast-forward mode easier to run smooth. Great improvements! :thumbsup:
Title: Re: E37's projects
Post by: E37 on February 13, 2017, 01:21:34 pm
Yep, impressive framerate. Also it should make a fast-forward mode easier to run smooth. Great improvements! :thumbsup:
Thanks!
That is the max framerate though.  <_<
Sorry I have been a little quiet. I have been busy programming.
I am rewriting the pathfinding in assembly to make it faster.
Thanks for the interest!  :thumbsup:
Title: Re: E37's projects
Post by: p2 on February 13, 2017, 01:34:18 pm
I ment if the game runs that fast in normal mode, you could sure boost the regular game process to twice the speed and still have an acceptable framerate that doesnt kill it as I assum most of the time is lost doing the rendering ^^ ;)
Title: Re: E37's projects
Post by: DJ Omnimaga on February 14, 2017, 12:36:29 am
You should post screenshots of the pathfinding in action under different scenarios :) (easy, complex, long, blocked, etc)

Also in Starcraft II, when an unit can't reach a platform or island, it just stops as close as possible.
Title: Re: E37's projects
Post by: p2 on February 14, 2017, 09:34:53 am
First I want to finish the graphics stuff, or at least get a little more of it done ^^
(FINALLY finishing the rest of the houses in higher definition and adding the missing tiles)  :)
Hope I can present first results today or tomorow :)
Title: Re: E37's projects
Post by: E37 on February 14, 2017, 06:14:01 pm
I ment if the game runs that fast in normal mode, you could sure boost the regular game process to twice the speed and still have an acceptable framerate that doesnt kill it as I assum most of the time is lost doing the rendering ^^ ;)
That sounds like a good idea.
I am finishing up my rewrite of the pathfinder in assembly. It is going to be half the size of my Axe version  :D (Half size always means 2x as fast right?  :P)
Sorry about my lack of screenies...  :'( It is such a pain to move the program and all it's dependents to wabbitemu to show it off. (currently it is 1 app, and 2 huge data files)
I changed how units move also. (I thought how I changed it was pretty cool and wanted to share it) Instead of moving every Nth frame, it changed to following a pattern. For example 1111000011110000 is the movement for the drill walker. It fits in one 2 byte number. The 1's represent the frames that the unit moves and the 0's the ones that it doesn't. That move-pause pattern makes the walker look like it stepping!
Title: Re: E37's projects
Post by: E37 on February 20, 2017, 04:46:52 pm
Well... I may have to abandon the project just due to size limitations. It is already above 26000b and a large amount of features are unimplemented.
I will need to expand my skill before going forward.
Title: Re: E37's projects
Post by: DJ Omnimaga on February 20, 2017, 05:10:05 pm
That sucks E37, have you considered using that one utility that allows you to use up to 40 KB of code? Otherwise you might need to split more stuff into separate appvars, such replacing hardcoded material with data when possible.

However, there is a way to make Axe games that uses up to 1540 KB of code: Make the project into multiple axe programs launched from a TI-BASIC program using XCOPY (which can be found in Omnimaga download section IIRC, otherwise there's a copy in Illusiat Collection/Illusiat 13). Have the title screen, in-game menus and any cutscene become separate archived Axe sub-programs and the TI-BASIC program will do the work to launch the appropriate Axe sub-program with the help of XCOPY.8xp (which copies archived programs into prgmXTEMP000 to XTEMP016 when needed). You would need to use external data such as appvars so that the game data can be shared between each Axe program, but this technique would allow you to use up to 1.54 MB of Axe code.
Title: Re: E37's projects
Post by: TheMachine02 on February 20, 2017, 05:13:03 pm
Or you can use the pageswap axiom : https://www.omnimaga.org/axe-language/(tutorial)-using-the-pageswap-axiom/ which allow to store function in app.
Title: Re: E37's projects
Post by: E37 on February 20, 2017, 05:33:39 pm
Unfortunately, neither of those ideas will work. I am already swapping pages like mad for extra memory. All of the code is too intertwined for separate programs. I suppose I could move all the menus to a different area and that might gain enough memory.
My other option is to rewrite the entire program as a multi-page app in assembly. That would fix just about every problem I can think of but would take an extremely long time.

Just so you know, here is how the memory is structured:
I have a one page app (16000b-completely full), a program (8800b-max size) and a data file (16000b-mostly empty) and a second data file (0 - 16000b depending on how much space the user has free)
I can run code everywhere but the first data file. I can run code in the second data file, but can't read from the first when I am there. The map is in the first data file so often that is useless.
Between the app and the program, I have 400 bytes of executable space left.
Title: Re: E37's projects
Post by: DJ Omnimaga on February 20, 2017, 05:34:52 pm
What about Fullrene?
Title: Re: E37's projects
Post by: E37 on February 20, 2017, 05:49:37 pm
Here is the problem, I have two data files that occupy the exact same space.
The background:
All assembly code starts at $9D95. $FFFF-$9D95 is the remaining ram that the user gets. It is what you see in the memory menu. RAM (usually) goes from $8000-$FFFF. That space between $8000-$9D95 is taken up by the OS and free ram areas. That whole area ($8000-$FFFF) is divided up into two areas with $C000 as the separator. Without Fullrene or something like it, the OS refuses to run code past $C000. In my program, I swap the are between $C000-$FFFF out between what it usually holds and and extra area. If I run code (with fullrene) past $C000, when I swap to read the data file, my code there is unusable.

I hope I was clear. It is pretty hard to explain without a bunch of other background.
Title: Re: E37's projects
Post by: DJ Omnimaga on February 20, 2017, 05:51:41 pm
Ah I see, that sucks then. I guess your only option would be to separate menus (and if applicable, cutscenes/win/lose screens) from the main executable. I hope this project doesn't die, though, even if it means having fewer features and dumber AI.
Title: Re: E37's projects
Post by: E37 on February 20, 2017, 05:55:22 pm
I could finish the project today if I needed to. It wouldn't have any real challenges though. Most of the units are finished, but there aren't any enemies. (you do run out of air though)
I may end content there and work on debugging, adding the last levels and rewriting the whole thing in assembler as a multi-page app.

What do you think?
Title: Re: E37's projects
Post by: p2 on February 20, 2017, 06:22:02 pm
You're. Den working on it for such a long time, I think you should really try to finish it, doing that thingy with moving the menus to an external program :) if that fails you could still go for any alternatives :)
Title: Re: E37's projects
Post by: E37 on February 20, 2017, 06:50:45 pm
"Oooooh! Wait! I have an idea!" - Rushes off to do hacky things.
I may have a way to have the program code run past 8811b anyway!  >:D
I will trade 1 lost frame every thousand or so for an extra 8000b of code. Sounds like a good deal to me!
Title: Re: E37's projects
Post by: Sorunome on February 21, 2017, 04:40:53 pm
Well... I may have to abandon the project just due to size limitations. It is already above 26000b and a large amount of features are unimplemented.
I will need to expand my skill before going forward.
How are you currently doing memory mapping and thelike? I'm curious because we discussed this quite a lot on IRC ^.^

EDIT: nevermind, i just read the post.

Why couldn't you use the pageswap axiom? That allows you to swap in different things in MemA, just what you said would fix all your issues "if i made it an asm multi-page app it would fix all the issues".
Using some custom script stuff you might be able to combind them into a single large app, even though it is axe, not too sure on that, though, you'd have to change some addresses in your branch tables (should be doable) and change the header and then re-sign. Developing might be very hard, though.
Title: Re: E37's projects
Post by: DJ Omnimaga on February 21, 2017, 08:10:38 pm
I think he mentioned something about safeRAM conflicts, such as his game using the same RAM areas as Fullrene. I don't know if Runprgm or Pageswap would have similar problems.
I could finish the project today if I needed to. It wouldn't have any real challenges though. Most of the units are finished, but there aren't any enemies. (you do run out of air though)
I may end content there and work on debugging, adding the last levels and rewriting the whole thing in assembler as a multi-page app.

What do you think?
I guess if all else fails you could turn the game into a puzzle strategy like this.
Title: Re: E37's projects
Post by: E37 on February 22, 2017, 10:43:04 pm
So... after an intense programming and debugging session, I am ready to try a beta release.  :w00t:
As the game currently stands, there are no challenges besides running out of air (which is pretty difficult in the later levels)
If anyone is interested in testing the game pm me and I will send you the game and instructions on how to play it.
Thanks for all the support!
Title: Re: E37's projects
Post by: p2 on February 22, 2017, 10:47:03 pm
that is very, VERY impressive!! I really LOVE how u can select units with the cursor, those controls look most intuitive and advanced, much better thsn most other games, I am really impressed  :thumbsup:
Awesome job you did there!!  :love:
Title: Re: E37's projects
Post by: DJ Omnimaga on February 23, 2017, 06:41:18 am
Very impressive so far. I would definitively like to give it a try if there are instructions. ALso I like the unit movement and selection. It almost feels like a real strategy game.
Title: Re: E37's projects
Post by: E37 on February 23, 2017, 11:08:21 pm
Here is the beta. All the instructions are in the readme.
I THINK that the app is correctly signed.
Title: Re: E37's projects
Post by: DJ Omnimaga on February 26, 2017, 02:30:16 pm
What's a readme?

Jk I'll give this a try soon (maybe Tuesday?)
Title: Re: E37's projects
Post by: E37 on February 26, 2017, 03:02:03 pm
What's a readme?
O.O

I found one other bug: opening the menu (with the graph key) and then closing it without doing anything leaves an empty rectangle on the screen. Scrolling offscreen removes it. I fixed it but haven't updated the download.
Title: Re: E37's projects
Post by: DJ Omnimaga on March 05, 2017, 05:34:43 am
My readme comment was because so few people actually read them :trollface:

I didn't have time to download the game and try it yet but I really can't wait to do it soon. I was side-tracked with various life things, the music CDs project and more recently Zelda: Breath of the Wild <_<

:walrii:
Title: Re: E37's projects
Post by: E37 on March 12, 2017, 01:37:42 pm
I am continuing to debug and am finishing up creating the last couple levels!
Mostly movement bugs are all that is left.
Title: Re: E37's projects
Post by: DJ Omnimaga on March 12, 2017, 03:57:01 pm
Glad it's coming along nicely. Make sure the level order is somewhat balanced so that we play most veryhard levels first, the bats*** insane hard ones second and the sadistic ones last. :P
Title: Re: E37's projects
Post by: p2 on March 12, 2017, 06:37:06 pm
indeed, but a difficulty setting would be awesome, too ;D
Title: Re: E37's projects
Post by: DJ Omnimaga on March 13, 2017, 05:21:45 am
I was kidding about how some games got difficulty settings that only includes hard modes or where even the easy mode is hard :P. But also calc games tend to be hard

Edit by p2: removed the SENT FROM MOBILE thingy

EDIT 2: :walrii:
Title: Re: E37's projects
Post by: E37 on March 14, 2017, 04:46:35 pm
I'm back to work after taking a short break. The levels are a race against time until you can get a support station. After that, it is much more resource management.  The later drillers are quite powerful and you need to create the infrastructure to support them or your calc slows WAY down. You probably won't be losing a lot of levels. (the first couple are impossible to lose) It is more focused on planning and building. I have created all but the last level by now. I would like to add a random map generator, but that seems unlikely to happen due to space problems.
I am patching up the last couple bugs with the end levels. Levels 1-11 are completely stable (I have completed them 6+ times each without any bugs)
The big problem is that past level 11 some maps are bigger than 32x32 tiles (256 pixels) so I have to patch some really weird visual bugs.
Another beta release within the week!
Title: Re: E37's projects
Post by: E37 on March 28, 2017, 11:44:14 pm
Another beta release within the week!
I sure am punctual...

This could very well be my last update. Two weeks ago I found a but that caused slight memory corruption when revealing a large cavern which is not noticeable until the game quits. It only happens past Frozen Frenzy.
I still have not found a fix. I will post again IF I can fix it.
Other than that, I introduced a bunch of small tweaks and a new unit. Other than that one bug, I believe I have finished debugging.
I have to stop because I have hit the limit of the calculator - it is simply not fast enough.
Playing the game up until Frozen Frenzy Is the best approach. Later levels can suffer form lag because of their large size. However if you don't mind a bit of lag and the possibility of a ram clear, those levels are the coolest. (The last level especially, you can spend hours exploring and still have areas to uncover)
If I get some interest I can make a unit and strategy guide.

Until next time,
E37
Title: Re: E37's projects
Post by: DJ Omnimaga on March 29, 2017, 05:42:36 am
Awesome to see an update and download. Too bad you couldn't manage to fix the other issues, especially speed/size-wise. This still looks very impressive nonetheless. :)

By the way @E37 you should make a separate topic with this game/screenshot in the first post so I can include it in the downloads section (which requires one topic per game with a download link in the first post). I'm gonna try to find some time to test this, although I can't promise anything.

Do you have any ideas in mind for other projects, regardless of if it's for calculators or not?
Title: Re: E37's projects
Post by: E37 on March 30, 2017, 05:22:14 pm
I am still working on the bug. I will make a post when fix it/give up. I am making a workaround for right now.
Thanks for the support!
Title: Re: E37's projects
Post by: DJ Omnimaga on March 31, 2017, 04:27:40 pm
Ok good luck :)
Title: Re: E37's projects
Post by: E37 on April 01, 2017, 07:08:38 pm
Good news everyone!  8)
I fixed the bug! :w00t: I am making several tweaks and will have a final version (with a separate thread) out soon.
All known issues are fixed.