Join us on Discord!
You can help CodeWalrus stay online by donating here.

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

Started by alexgt, April 20, 2015, 12:22:42 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

alexgt

#105
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.
  • Calculators owned: Ti-84+, Ti-Nspire, Hp Prime, Broken HP Prime, HP 48SX

bb010g

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.
  • Calculators owned: HP 50g, Prime, 28S, 35S, Casio Prizm, dead Nspire CX CAS

bb010g

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.
  • Calculators owned: HP 50g, Prime, 28S, 35S, Casio Prizm, dead Nspire CX CAS

Duke "Tape" Eiyeron

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.
  • Calculators owned: A lot.

bb010g

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.
  • Calculators owned: HP 50g, Prime, 28S, 35S, Casio Prizm, dead Nspire CX CAS

Duke "Tape" Eiyeron

ANother indication inline gives : type checking. Oh and templates, IIRC, allows to check which type will use which member/function.
  • Calculators owned: A lot.

bb010g

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++.
  • Calculators owned: HP 50g, Prime, 28S, 35S, Casio Prizm, dead Nspire CX CAS

Duke "Tape" Eiyeron

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. :/
  • Calculators owned: A lot.

alexgt

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 :).
  • Calculators owned: Ti-84+, Ti-Nspire, Hp Prime, Broken HP Prime, HP 48SX

alexgt

UPDATE:
- App for sprint
- Animations for block break
That is all :)
  • Calculators owned: Ti-84+, Ti-Nspire, Hp Prime, Broken HP Prime, HP 48SX

bb010g

  • Calculators owned: HP 50g, Prime, 28S, 35S, Casio Prizm, dead Nspire CX CAS

Dream of Omnimaga

YEah I am curious about what that means too. Also nice animation. Do you use the same for every block using transparency and stuff?
  • Calculators owned: TI-82 Advanced Edition Python TI-84+ TI-84+CSE TI-84+CE TI-84+CEP TI-86 TI-89T cfx-9940GT fx-7400G+ fx 1.0+ fx-9750G+ fx-9860G fx-CG10 HP 49g+ HP 39g+ HP 39gs (bricked) HP 39gII HP Prime G1 HP Prime G2 Sharp EL-9600C
  • Consoles, mobile devices and vintage computers owned: Huawei P30 Lite, Moto G 5G, Nintendo 64 (broken), Playstation, Wii U
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Unicorn

Looks cool! Do you have to hold it down to activate the animation, or is that just one tap/click making that animation?
  • Calculators owned: I own all of them: PICKACHUP TI 84+ CSE TI 83+ SE TI something something ??? ??? ??? ??? ???
  • Consoles, mobile devices and vintage computers owned: PICKACHUP ??? ??? ??? ??? ???



??? ??? ??? ??? ???

CKH4

I think that you press the app key to sprint.
  • Calculators owned: TI-83+, TI-84+


Snektron

That looks awesome! Are you going to add some kind of background btw?
  • Calculators owned: TI-84+
Legends say if you spam more than DJ Omnimaga, you will become a walrus...


Powered by EzPortal