Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: How to go from Multimediafusion(MMF)/GameMaker(GM) to code based game creation.  (Read 5166 times)

0 Members and 2 Guests are viewing this topic.

Norda

  • Newbie
  • *
  • Posts: 2
    • View Profile
Hello, I am student who have started to learn c++ and SFML. I have read some tutorials and such on development in SFML. But I can't understand how you can keep track of an entire game scene or even a whole game with just bars of code. Like in MMF and GM you can easily place out where you want objects to be. And it's really easy to keep track of game objects and their induvidual coding. But when trying to apply this to SFML c++ it gets so messy, and there is so much to keep track of, is there any good tutorials on how to go from such a program or do you have any tips for me?

Would really appreciate some help on this topic, because I really want to convert to coding my games because in code you chose exactly how everything should be handled.

Gleade

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
Hi,

I (and I'm sure many others) was in the exact position you are in when I first started shifting from game engines (such as Game Maker) to pure code many years ago. Code can get messy, fast. It is mainly lacking overall programming experience and therefore, your code management is nonexistent. I didn't know where to start either, I didn't even know what keywords to search in google. So I decided the best thing to do, was to invest in a book. This was the book I picked up:

SFML Game Development
https://www.packtpub.com/game-development/sfml-game-development

It taught me the basics on how to manage my code, split code up into appropriate classes and using the correct containers for the right job. You can learn similar things online however; IMO, books are worth the quality.
« Last Edit: August 11, 2017, 01:37:47 am by Gleade »

Norda

  • Newbie
  • *
  • Posts: 2
    • View Profile
I will try the book out, thank you for your advice! :)


Eyfenna

  • Newbie
  • *
  • Posts: 12
    • View Profile
SFML Game Development
https://www.packtpub.com/game-development/sfml-game-development


this might be offtopic, yet I aquired this book myself and am fascinated by the topic of scene graphs. i did some google research on this  topic yet found only sites that explain the uses of existing programs relying on scene graph (i.e. open scene graph and similars)

I was wondering if there is someone who knows more about scene graphs or if theres further lecture on it?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Scene Graphs are quite a generic topic. If you find something for another implementation, you'll most likely be able to apply the idea to your own scene graph.

What kind of information are you looking for?

https://en.wikipedia.org/wiki/Scene_graph
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Eyfenna

  • Newbie
  • *
  • Posts: 12
    • View Profile
Scene Graphs are quite a generic topic. If you find something for another implementation, you'll most likely be able to apply the idea to your own scene graph.

What kind of information are you looking for?

https://en.wikipedia.org/wiki/Scene_graph

basically different node types, the book provides source code for a generall do it all node while other sources in the internet disringuish between group and renderable nodes.

open scene graph, I think, knows a structure like switch node.

secondly even when command is a good pattern to influence leafs it fells a bit clumsy in so far as I have to modify the source code of the leaves for a command to work and was wondering if there are other patterns that can be used in the same way?

Eyfenna

  • Newbie
  • *
  • Posts: 12
    • View Profile
I'm playing arround with particle effects and while I'm not managed to code the finder function to connect emitter nodes to particle nodes I managed to code some affectors as lambda functions, in case somebody wondered about how this can be done.
I'm on the other hand am interested in how can the finder command be done?

Simple fall from up to down:
Code: [Select]
function<void(Particle&, Time)> Fallaffector = [&](Particle& particle, Time dt) { particle.position += Vector2f(0.f,50.f)*dt.asSeconds();};
Can look comparable to a waterfall cascade in case start position of particle is randomized as (start position + std::rand()%factor):
Code: [Select]
function<void(Particle&, Time)> Fallaffector = [&](Particle& particle, Time dt) {float posx = (particle.position.x - 400.f) / 2; if (particle.position.y < 350) { particle.position += Vector2f(-posx / 15 + static_cast<int>(particle.position.x) % 30, std::rand() % 50 + std::rand() % 75)*dt.asSeconds(); } else { particle.position += Vector2f(std::rand()%140, std::rand()%50)*dt.asSeconds(); }};
Circular rotation around 300 300:
Code: [Select]
function<void(Particle&, Time)> Rotator = [&](Particle& particle, Time dt) {Vector2f pos = particle.position; float s = sin(55); float c = cos(55); pos -= Vector2f(300 , 300); float xnew = pos.x*c - pos.y*s; float ynew = pos.x * s + pos.y * c; xnew += 300; ynew += 300; particle.position = Vector2f(xnew, ynew); };
Lines become a rotating cloud
Code: [Select]
function<void(Particle&, Time)> Rotator = [&](Particle& particle, Time dt) {Vector2f pos = particle.position; float s = sin(55); float c = cos(55); pos -= Vector2f(300 + std::rand()%10, 300); float xnew = pos.x*c - pos.y*s; float ynew = pos.x * s + pos.y * c; xnew += 400; ynew += 300; particle.position = Vector2f(xnew, ynew); };