Quote from: alexgt on May 12, 2015, 02:15:57 AMAs 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.Quote from: bb010g on May 12, 2015, 12:30:55 AMYeah 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 .Quote from: alexgt on May 12, 2015, 12:05:13 AMThe 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.
/\ ? 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
I hope subs don't slow it down too much I have 99999999999999999 of them it seems