You can help CodeWalrus stay online by donating here. | New CodeWalrus | Old (dark mode) | Old (light) | Discord server

[Minecraft] [HP Prime] MinePrime - Minecraft on a Hp Prime!

b/[Inactive] MinePrime (HP Prime) Started by alexgt, April 20, 2015, 12:22:42 AM

Previous topic - Next topic

0 Members and 19 Guests are viewing this topic.

u/alexgt May 12, 2015, 02:15:57 AM
Quote from: DJ Omnimaga on May 12, 2015, 01:52:44 AM
Also a bug report in the latest version: The delay that makes the game runs at the same speed in the emulator doesn't appear to work at all. Another issue is that we can destroy bedrock.
I haven't made checks for what blocks you can break so you can break the world I guess :P!

Quote from: bb010g on May 12, 2015, 12:30:55 AM
Quote from: alexgt on May 12, 2015, 12:05:13 AM
/\ ? Commands might be possible. If I find a way to make "mods" then I might make it an addon, any ideas on how to do that, it people could make mods for MinePrime I think game play could be really interesting and involve you guys more :)
The thing that bugs me about extensible behaviors, like mods, on the Prime is that they would have to be referenced (AFAIK) through strings and called via expr. That makes things slow. Even in a simple paint program, using strings and expr function calls, as opposed to direct calls, is noticeably slower. The alternative I see is hard coding in your mods when adding them, but that smells. PPL needs some way to deal with program/namespace, variable, and function references for a mod API to work. With more than 3 calls per tick, it'll get slow.
Yeah I thought you would have to hard code it into the game but the problem with that is I didn't start this project with other people understanding my code enough to make a mod so I should go through and comment it all <_<.

I hope subs don't slow it down too much I have 99999999999999999 of them it seems O.O

I wonder if Source ever gets completed I could do that. It would be nice to see more people with Primes to program as they are my new obsession.
Last Edit: May 12, 2015, 02:17:54 AM by alexgt
u/bb010g May 12, 2015, 02:26:36 AM
Quote from: alexgt on May 12, 2015, 02:15:57 AM
Quote from: bb010g on May 12, 2015, 12:30:55 AM
Quote from: alexgt on May 12, 2015, 12:05:13 AM
/\ ? Commands might be possible. If I find a way to make "mods" then I might make it an addon, any ideas on how to do that, it people could make mods for MinePrime I think game play could be really interesting and involve you guys more :)
The thing that bugs me about extensible behaviors, like mods, on the Prime is that they would have to be referenced (AFAIK) through strings and called via expr. That makes things slow. Even in a simple paint program, using strings and expr function calls, as opposed to direct calls, is noticeably slower. The alternative I see is hard coding in your mods when adding them, but that smells. PPL needs some way to deal with program/namespace, variable, and function references for a mod API to work. With more than 3 calls per tick, it'll get slow.
Yeah I thought you would have to hard code it into the game but the problem with that is I didn't start this project with other people understanding my code enough to make a mod so I should go through and comment it all <_<.

I hope subs don't slow it down too much I have 99999999999999999 of them it seems O.O
As I said with @DJ Omnimaga¸ functions aren't the problem. A nice method of dispatching arbitrary functions is. It would be nice to be able to auto-detect mods and load them on startup and disable them live. You could do this right now with Programs and checking MyMod.isMinePrimeMod or something, adding it to a list, and then iterating through that every tick, calling functions that have been separated out on functionality likewise like tickMods(i).onGameTick(state, whatever) and invMods(i).onInvTick(state, whatever) (I'm not familiar with your code), but to make those calls currently you'd need to use strings and EXPR. You'd STRING the arguments, EXPR would re-tokenize them, the function would be evaluated, and the result would be returned. String manipulation is slow. That is why a nice reference system for programs/namespaces, variables, and functions would be great. That wouldn't be as slow. It wouldn't be as fast as a single compiled program, but it's still compiled at compile-time, not run-time repeatedly, and would be very usable (unless they're implemented extremely jankily). See also: C function pointers.
u/bb010g May 12, 2015, 02:39:00 AM
Quote from: alexgt on May 12, 2015, 02:15:57 AM
I wonder if Source ever gets completed I could do that. It would be nice to see more people with Primes to program as they are my new obsession.
You're thinking of inlining. That wouldn't fix everything. Inlining fixes a specific set of problems: short (relative) functions. Function calls are not as fast as just go go going through a piece of code straight through. E.g. min or max. In C they're normally implemented like #define min(x, y) (((x) < (y)) ? (x) : (y)). This is quite literal inlining—before compilation, the pre-processor turns min(1, 2) into (((1) < (2)) ? (1) : (2)), which the compiler normally reduces to 1, even before it's ran. In C++, you'd use templates, as they have the same aggressive inlining of any function in a modern C/C++ compiler and can be made to work on any type that has < (basically). In Haskell, it's just min x y = if x < y then x else y, as Haskell inlines aggressively also. However, figuring out when to inline is hard. C++ and Haskell inline aggressively because they're finely tuned and know what's too aggressive, an important piece of knowledge at runtime. A beginning language, like PPL or Source, would probably have a distinct inline tag on functions or macros. Both are going to be compiled away always. (Probably macros, as you could reference inline functions and force the insertion of such a function into a program like normal to be used. This may not be desirable. I haven't looked into the logistics that much.) Anyhow, with a large macro or function, code duplication starts to set in—not in the source proper, but in the compiled output. Repeating all those statements isn't free. That's why functions exist: they allow for reuse at runtime. Making a game out of macros would be large and unwieldy, as the compiler essentially deals with a monolithic function. Macros are not a magic bullet.
u/Duke "Tape" Eiyeron May 12, 2015, 05:47:27 AM
I also want to note that since few version of GCC (like a dozen), inline functions on C and C++ exist only to give the control and the syntax check of any normal function while asking the compiler to be inlined as a macro would.
u/bb010g May 12, 2015, 04:15:38 PM
Quote from: Duke "Tape" Eiyeron on May 12, 2015, 05:47:27 AM
I also want to note that since few version of GCC (like a dozen), inline functions on C and C++ exist only to give the control and the syntax check of any normal function while asking the compiler to be inlined as a macro would.
AFAIK, inline only serves to not error on repeated function declarations (e.g. in a header included multiple times). Suggestions to inline are pretty much completely ignored in most modern compilers. Without aggressive inlining, templates wouldn't work.
u/Duke "Tape" Eiyeron May 12, 2015, 06:55:12 PM
ANother indication inline gives : type checking. Oh and templates, IIRC, allows to check which type will use which member/function.
u/bb010g May 12, 2015, 07:06:34 PM
This is what inline does in C: http://stackoverflow.com/a/7767858/1098906
This is what inline does in C++: http://stackoverflow.com/a/1759575/1098906
In general, the inline notation does not do what you'd think it would do in C/C++.
u/Duke "Tape" Eiyeron May 12, 2015, 07:26:49 PM
Yeah, unfortunately, the compilers are in their right to allow/deny the user use of the keyword. Alas, I was still in the "in a decade it was true" mindset. Well, I hoped they were cleaner to use than preprocessor macros. :/
u/alexgt May 12, 2015, 08:38:21 PM
Mods could be written in external programs that are then called where the modder makes them called at in the program. But all of that will be really complex to incorporate into it so if stuff ever surfaces so we don't need to d allot of trickery would work quite well but until then guess we will have to stick to no mods :(.

I will post this now encase I don't have enough time to make and update post be cause one is ready and I don't want to rely on DJ_O or anyone else to post screenshots although it is appreciated :).
u/alexgt May 13, 2015, 01:37:17 AM
UPDATE:
- App for sprint
- Animations for block break
That is all :)
u/Dream of Omnimaga May 13, 2015, 04:59:00 AM
YEah I am curious about what that means too. Also nice animation. Do you use the same for every block using transparency and stuff?
u/Unicorn May 13, 2015, 07:28:49 AM
Looks cool! Do you have to hold it down to activate the animation, or is that just one tap/click making that animation?
u/CKH4 May 13, 2015, 01:39:16 PM
I think that you press the app key to sprint.
u/Snektron May 13, 2015, 01:50:43 PM
That looks awesome! Are you going to add some kind of background btw?
Website statistics


MyCalcs | Ticalc.org | Cemetech | Omnimaga | TI-Basic Developer | MaxCoderz | TI-Story | Casiocalc.org | Casiopeia | The Museum of HP Calculators | HPCalc.org | CnCalc.org | Music 2000 Community | TI Education | Casio Education | HP Calcs | NumWorks | SwissMicros | Sharp Calculators
Powered by EzPortal