Pokitto is on the way, what games should I make?

Macros don’t have any impact on whether something’s computed at compile time or not.

The macro system is just a glorified copy-paste machine.
It’s entirely up to the compiler whether something is computed at compile time and it will make that decision regardless of whether you use macros or not.

Small anecdote

When working on Dark & Under I found that replacing the abs macro with a template function resulted in smaller code because the expansion of the abs macro produced an expression that was either too complex for the compiler to properly optimise or that the compiler couldn’t optimise for legal reasons.
(I would expect a non-template function specialised for the types involved would have had the same result or smaller code.)

When you say ‘using C’ do you mean “the subset of C++ that resembles C” or actual C?
Because behaviour will differ depending on whether you’re using .c files or .cpp files.

(And if you’re mixing .c and .cpp files then sometimes the compiler will start behaving awkwardly (as I found out recently).)

If you’re using the “common subset of C and C++” then I think I know what your problem is, and it’s down to how the inline keyword behaves differently in C++ to how it does in C.

If you’re using actual C then this SO answer may or may not help solve your problem.

You underestimate copy pasting :smiley: It’s a powerful computational model and can be as general as Turing machine (macros lack this generality, but can still do a lot of stuff).

Well, it’s a subset of C++ that is C. Some programs I compile as C, e.g. my SDL PC demo, and some as C++, e.g. the Pokitto demos. I try to make sure they all work correctly.

Yes, I really should do this. I came across some SO threads, but they were too long for me to read :smiley: Again, my laziness. I’ll have to do something about it.

That doesn’t change the fact that macros have no impact on what gets computed at compile time.

Text substitution happens before the code is processed,
thus what the compiler ends up seeing is the code after text substitution,
and the compiler will optimise based on that code (post-substitution).
Effectively the compiler has no knowledge of macros because substitution has already happened before the actual compilation phase begins.

The most you can ‘precompute’ with macros is token and text concatenation.
Otherwise, they have no bearing on what gets precomputed,
they have the same effect as if the programmer had done the text substitution by hand.
(I’m talking about C and C++ macros specifically, not the general case.)

That’ll be your problem then.
inline has very different meanings in C and C++.

In C it’s a hint to the compiler to inline a function.

In C++ the presence of the word inline indicates that a function has inline linkage,
which means that the function must be defined in the same translation unit in which it is declared.

Despite popular belief, in C++ inline is not a hint to the compiler to inline a function.
(Some compilers do still treat it as a hint, but the standard does not specify that it should be, so that’s implementation-defined behaviour.)

From cppreference, C section:

The inline keyword was adopted from C++, but in C++, if a function is declared inline, it must be declared inline in every translation unit, and also every definition of an inline function must be exactly the same (in C, the definitions may be different, as long as the behavior of the program does not depend on the differences). On the other hand, C++ allows non-const function-local statics and all function-local statics from different definitions of an inline function are the same in C++ but distinct in C.

From cppreference, C++ section:

In C, inline functions do not have to be declared inline in every translation unit (at most one may be non-inline or extern inline), the function definitions do not have to be identical (but the behavior of the program must not depend on which one is called), and the function-local statics are distinct between different definitions of the same function.

2 Likes

Okay, I found this:

static inline is by far the most portable definition at the moment

Works fine now :slight_smile:

2 Likes

Trying to do something with floors – here is an attempt at texturing and a shadow/mirror effect (accidental feature once again). Very WIP and not actual FPS:

out21

This has quite a nice atmosphere if I can say so :slight_smile:

I don’t have the floor texturing figured out yet BTW, this is just trial-error balanced formula. I’ve put magic constants in that I don’t know what they do :no_mouth:

6 Likes

That looks like a Pokitto version of system shock! And I thought the Pokitto was just a small upgrade over the Arduboy… You just prove me wrong…

But after all the Bells and whistles will there still be space to make a game with all this… I guess that’s where the real question is. But at this rate you will stop surprising me in around 100 years lol

2 Likes

Can you still do the height doom like stuff with this then it really could look like system shock :3

Understatement of the month :wink:

2 Likes

So, when can we expect the remake of “007: Goldeneye” to be finished? :P

You’re trying to upset me on purpose, aren’t you? :P

In fairness, the Arduboy does have a 3D game.
FManga’s pod racing game.

You could probably get a semi-decent raycaster working on Arduboy,
but whether you’d have the space to turn it into a proper game is an entirely different question.

3 Likes

No I promise :smiley: I’ll figure it all out, I just quickly bundled it together to see what it would look like. When it comes to formulas I never have peace until I understand what’s going on, so definitely no magic constants in the final product.

I’ve seen a few very nice raycasting projects, with texturing, sprites and stuff, far beyond my expectations at the time. Unfortunately none finished AFAIK.

1 Like

This is the very reason why I started developing my own console. I was trying to make games on the atmega (ie. Gamebuino & Arduboy) (proof) but making anything proper you’d run out of memory before getting to implement gameplay.

3 Likes

@jonne
So you think it will still be possible to make a game using that demo? Maybe if we can stream level data from the SD card maybe, if not I fear not much would fit in memory.

if its just like this wolf map you could squize a map in as a sprite, im not sure how much ram is actualy in use for all the casting?

you probebly could load in a level witout streaming it, if you devide the level up with stuff like air locks (going with the space theme) you can load a new level with ease where you just have the airlock as a commen room

This is my feeling about Arduboy too. I love super minimalist games too, but I also want to go bigger sometimes. Pokitto is perfectly balanced for this.


@Vampirics @adekto I haven’t checked the memory usage lately but I think there’s plenty room left for decent content. I want this to become actual games, not just tech demos (by me or someone else).

say the word, im in if you wanna make a community game out of it :smiley:

2 Likes

One idea I’ve been playing with was something like this:

Pokitbeasts 3D maybe? :smiley:

BTW if you want to start something based on my engine, you can do it even now, no need to wait for “official” release. There’s no warranty, lots of things are WIP and the API can change, but if you’re okay with it, there’s nothing stopping you. (On the other hand waiting for a bit till I fix most stuff will probably save a lot of trouble, so it’s up to anyone.)

3 Likes

Cool stuff you re making! I really like the terminal demo. This one is probably running on a pc and not on the Pokitto? It reminds me of the Matrix.

lol ok thats an idea, but i do like the other prersented stuff aswell

for starting some games already or atleast content, sprite size and size of wall tile size would be helpfull to know. and can walls be on angles or are they always in a grid?

i like to look of the science finction style test and like i said before airlocks would be a way around level loading

this would not stop use from putting both games in a similar universe and pokitbeast could be present an element, though having some sort of rpg light shooting or inventory puzzling sound like fun in a 3D spaceship maze

I remember playing a TF2 map like that…

That’s precisely why I’m waiting.
When it’s done I’ll tear it up and C++-ify it :P

(I have a very particular idea of a certain game that I would like to make using a raycasting engine that has around 3-4 levels of height to it.)

(Presumably CC0 means I have to release it under the same licence right? Or could I shove MIT or Apache 2.0 on top?)

That’s assuming I get round to it.

I still have the Arduboy2 port to finish.
I’ve been too tired these last few days to make much progress.

𝅘𝅥𝅮 So much to do, so much to see… 𝅘𝅥𝅮

1 Like

Pokittomon?