26

@15 agreed re: shared_pointer and all that. Personally, even in C++ I tend to manually allocate and deallocate memory, and I think it's because of my C background. It feels more natural to me. So, I'm talking from an old-timer's perspective, when the C++ reference syntax and all that good stuff didn't exist yet. And that's made me biased.

Thumbs up

27

@24, what sort of maps have you worked with? The whole point of this thread (before all the comparisons between languages and styles ETC) was to come up with the "ideal engine". So I guess:

1) what mapping systems do people like, and how do they work?
2) Which should this super engine of awesomeness implement
3) (Optionally) how would code examples look in Python and / or psuedo code?

Cheers,

Take care,
Chris Norman
Selling my soul to andertons.co.uk since 2012.

Thumbs up

28

OK,
For anyone who wants to help out with the engine, either with ideas or code, and for anyone who wants to use (and get support with) it, I created a mailing list.

HTH.

Take care,
Chris Norman
Selling my soul to andertons.co.uk since 2012.

Thumbs up

29

As for map types, you have tiles/voxels (BK, Swamp), collections of objects (are there audio games that do this? The Swamp Platformer works this way, but what else?), for things which can be described in 1.5d there's a datastructure I don't know the name of... range/value list? I've tried coming up with ways to extend that to more dimentions and come up short. I'm having a harder time remembering everything I thought of yesterday sad.
Mainstream games, excepting the occasional strategy or Minecraft, are almost all objects, these days. There's a speed/memory tradeoff, where tiles are faster on handling movement and collisions, but the memory required scales with map size, while objects are slower with regards to physics, but memory usage cares more about complexity than size. Which I'd use would depend on the game. I propose, however, that if we're aiming to drag Audio Games out of the Dark Ages*, making object-based games easier to build blindly might be a good point of intervention. There are those who disagree that this is even possible, somewhy.

* Escaping the Dark Age does not require ousting any site admins. The Inquisition need not turn hither-toward.

Some of my games
Keep up to date by following @Jeqofire on twitter!
Ear Ninja?

Thumbs up

30

the map it's self, is a class.
it contains a list of tiles, which are objects.
This is just a basic implementation though. The structure can expand maybe with containing items, and soon.

...

Thumbs up

31

hi
about the serialization stuff etc, maybe boost.serialization can help (the code that ethin wrote in post 7 uses serial library) boost.serialization api is like that
about the sound engine, in C++ i use SoLoud which is a permissive (zlib licensed) library and for input etc i use sdl
about memory management, i'm as same as ethin.
i use unique_ptr for my memory management and it really works as i intend it
for physics, i think bullet is the best option (it can also be used from python as well)
anyway, i also love to help out

bitcoin address: 1LyQ3hziMC2DTnCtgM3V1zfuZ73P3CYT9P

Thumbs up

32

@29: I think tiles are ok, but offer limited possibilities. I tend to go with object collections for full range movement. It'd be simple to build a mapping system using object collections.

The nice thing about tiles though is that you don't have to loop through every object to check for collision and all that. But you lose preciseness.

Thumbs up

33 (edited by Ethin 2018-05-18 16:54:21)

@26, you can accomplish manual memory management in C++ with new/new[]/delete/delete[]. But I honestly don't recommend manual memory management at all...... it can be hard to remember to do it, and then you've got memory leaks all over the place that you don't know how to fix, so you need to call in valgrind/hellgrind. smile
To be honest, I'd go for the object collections. Memory isn't an issue unless you've got like a 30000x30000 map, with practically each tile taking up ten objects (assuming, of course, that an object is 128 KB... unlikely). In such a case you'd only be using approximately 37 MB for each dimension. So that really wouldn't be much of a problem; either way, such a map would be more resource-intensive on the CPU due to map creation, item processing, etc. (It would also be incredibly hard to play in multiplayer mode, and would be practically un-navigable in either case.) So, like I said, object collections would be your best bet here.
@31, I prefer Cereal better than boost.serialization simply because I have access to JSON, XML, and non-portable and portable binary outputs and inputs for structures. It might be possible to port Cereal to Python, given enough time (we'd be porting some of the C++ STL over too though). That would, however, be unnecessary and reimplementing the wheel simply because Python already has its own serialization libraries.
Sidenote: if we're going to drag the audio game industry out of the dark ages, then we need to stop going for 2D and go for 3D right away. It will be hard to do, yes, but it'll be worth it. smile

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.

Thumbs up

34

SoLoud is a 3d audio library (which i'm currently using)
and bullet is a 3d physics library as well (so, we can use that in the engine)

bitcoin address: 1LyQ3hziMC2DTnCtgM3V1zfuZ73P3CYT9P

Thumbs up

35

@34 I've never used SoLoud. I'll check it out though.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.

Thumbs up