Jump to content

  • Log In with Google      Sign In   
  • Create Account

Exoaria

Member Since 13 Dec 2012
Offline Last Active Feb 06 2016 11:36 PM

Topics I've Started

Dialog and Event trees

04 February 2016 - 03:37 AM

Game Engine: Godot Game Engine

Language: GDScript — Syntax very similar to Python

My questions are obviously within these bounds. I am very happy with Godot as an engine; and I do not think that my limitation to GDScript prevents me from any of what I aim to achieve: many have done so before me. It is almost entirely a matter of logic and the implementation of that logic within the bounds of resources available. With that said, let me propose my problem.

 

I am by no means an adept and fluent programmer, but my knowledge has been sufficient enough to make games in the past and I feel that I am capable of implementing whatever structures, systems and logic trees are suggested to me with some thought and exercise.

 

I have created a dialog system in Godot Game Engine which I am (somewhat) happy with, but does not achieve my core goal. Keep in mind this system was completely created by me and I was not following any examples, which could contribute to why it is so awful.

 

The first thing to note is that this system only allows any sign or enemy to have two states of text: An intro, and if specified, a continuation of that text. An exported variable lets me check a boolean to say "This character has two lines of dialog." — Upon speaking to the character they might say "Hello [player], my name is [entity], nice to meet you!" Then be flagged to say that the character has spoken to them.
Upon "activating" them the second time, the script will see that it HAS a second line of text, and then the NPC might say "It's a nice day today!"
 

The main core of this is done through three systems:
- Checking if the player is next to an interactive object.
- Passing the character details to a function which will query an external config file for appropriate dialog.
- Displaying the text on screen. (This part is fine, I'm totally happy with how it turned out)

 

Let's say that I have a Skeleton that the player can talk to. Its external parameters are this:
SECTION: GRAVEYARD (Its location)
KEY: SKELETON (Its identifier)
EXTENDED: True (Does this NPC have two lines of text?)

The script would then query a .cfg file which contains a dictionary of text; it would look like the following.

[GRAVEYARD]
SKELETON = {"INTRO": " Why don't skeletons fight each other?.","IDLE": "BECAUSE THEY DON'T HAVE THE GUTS!."}

 

The first time the player talks to him, the script would see that it has two lines of text. It would automatically search for "SKELETON" in "GRAVEYARD" in the config file. (See above.)

The script would then retrieve the dictionary value held in "INTRO" and flag the NPC such that the next time the script is called it searches for the "IDLE" dictionary value.
The player then activates it again, the script sees the flag, and then looks for "IDLE" instead of "INTRO".

This is the best that I could do. And it's god awful. It serves no purpose, other than to display two different mundane pieces of text. 

So why don't I use the system to enable more?

This is where my logic runs out. Bam. None.
The way that Godot (and MANY other engines, including Unity) handle objects are through nodes. These are the equivalent to Unity prefabs. I create an object and I have the luxury of attaching a script to it, which defines the way that ALL of those objects will behave, which saves me a lot of coding. Obviously there is a ridiculously easy solution to this, but my experience doesn't allow me to think of one, which is why I am here.

If the script searches for an invalid dictionary, the whole game crashes. If it searched for "IDEL" instead of "IDLE" — it's game over. (No pun intended.) So a solution would be to create a different script for each NPC in the entire game, but this doesn't work. What I need is a dialog tree which can be safely called by all NPC's in the game to get different text based on the situation. Is the player low on health? The NPC could say "You look sick!", is the player on a quest? The NPC could say "I hope you've killed those pesky Goblins!", has the player just saved someone's life? They could say "Wow, thanks for saving me!"

I will probably never use such complicated trees, and my current system could pass for this game as it's only a Castlevania-esque platformer. But it does me no favours, and while it has taught me a lot, is a huge bottleneck not only for creating dialog, but for my event system (flipping switches, opening doors with keys etc.) which works very similar to the above.

I have researched dialog trees, but they're all in the context of LUA/C++ which I obviously can't use. I'm pretty sure Godot supports XML but I don't think it can read XML files in the usual way — in that XML is specifically just a format for saving scripts or prefabs. I have a Config File system which can store any kind of variable or dictionary, and a surprisingly powerful scripting language that can do just about anything that Python can do.

I guess the best way to describe my limitation from my point of view is that I don't know how to create a system where entities or interactive objects behave differently while still using the same script. Obviously, there are other factors, and dozens of ways around it, but I really really really need a push in the right direction. Please give me some logic advice, or ways that you tackled similar issues. Thank you so much for taking the time to read this.


Where are the .a files in SFML 2.0?

28 June 2013 - 03:28 AM

I am trying to use Code::Blocks to write up my supernoob first 2D graphics of a deformed excuse for a shape on my screen.

All seemed to be well and good, I added the SFML-2.0\include\ folder and followed the documentation for my incredible green circle, my IDE was smiling brightly upon me as I it recognized the RenderWindow term and allowed me to place in parameters without proceeding to mock me by filling my log up with red text and references to objects that I never even wrote. Upon excitedly hitting the F9 key to build and run my new AAA game that was going to make me millions of dollars and revolutionize the market, I was finally spammed with the sadistic shit that the IDE was taking pleasure in letting out on me with an error message on almost every line.

It's relatively the same error each time:

sFdXibA.png

 

Anyway. Some Google searches suggested that I hadn't placed in the appropriate library files (I had linked to the .lib's beforehand) and so I went on to fix my problem based on my own incompetence when... there's no ".a files" at all. It clearly suggests that they are in the lib folder. But there are only the basic libraries (system, system-s, system-d, window-s etc.) in .lib format.

If I can't even figure this one out I might as well seek a new career line as a catholic priest. So someone please tell me what the heck I'm doing wrong before I repent to the good lord for all my wrongs and move to Russia where I can spank mutant deer with my new acquired religious friends. You guys are about to determine my future.


Touching base with GameDev... Where do I go from here?

27 June 2013 - 07:46 AM

I find that this community has a reliable sense of direction and that's also something I can appreciate when I'm finding myself lost every five minutes. Anyway.
So I went to watch TheNewBoston's tutorials on C++. I have now watched all 73 tutorials and I've completed all the tasks given. Keeping in mind that I originally wasn't going to learn the language on its own but through gaming tutorials in development with C++, I've now decided that it's best for me to learn the language itself. Obviously I'm no expert, but I've learned a decent amount and I've grasped the whole idea behind OOP finally.

tl;dr I'm able to understand and code in C++ syntax now and see where I go wrong.

 

I want to know now what the next step is. Some people are telling me to head on with OpenGL (or SFML) and others are telling me to just use UDK. I don't want to use an engine because I want to spend the next few years building my knowledge up from the ground.

 

Should I learn SFML and how to use it with C++ or move onto finding a tutorial series that shows game development with SFML at the same time? Does anyone have links or references to places I could find these?

Anyway, just any kind of directive advice I will appreciate a lot.
Again, I really don't want to learn Unity or UDK. I'm happy to make terrible games coding them myself until I get better.

Thanks.


Basic Concepts of Programming

22 June 2013 - 07:15 AM

I'm hearing a lot of fancy words the more I grow interested in programming. I don't really understand a lot of it. I wish programming tutorials would give more information about what they're talking about. Let's use C++ for example.

I know that setting a function to void means that it doesn't return a value. Returning 0 simply means that the program ran correctly. No programming tutorial has told me more than this. They have only ever elaborated on those facts. When I ask myself "In what situations should I set a function to void?" or "If I return 0 in another function, what would happen? Why would it cause an error?" I don't know how to answer them.

 

These might seem like insignificant details to you, because I could go on without them. But I want to know exactly when I should be using void, and when I should be returning a variable.

 

Object Oriented Programming is said to take data and code and put them into an object. They say this differs from traditional programming methods but I have no idea what traditional methods were and how different they were. I don't know the difference between my "code" and the "data". Can anyone please relate to me and see why I'm struggling?
It's almost like nobody bothers to sit down and take the time to explain why these things are so. Every tutorial I watch, book I read does not elaborate enough and it drives me up the wall. But enough complaining.

 

Can anyone give me some basic run through of the most basic principles of coding. I understand what integers are, floats, strings, booleans - for example. I know that it's more effective to use a single instead of a double when you're working with a smaller number, but why? I just need some explanations on common misconceptions and reasoning behind the crap I'm typing. I see it coming together, I see it working, but I don't know why it's working and I struggle to replicate it later because I don't know the reasons why I put certain things in places the first time.

 

If typing something up here is too much to ask for, that's probably right, lol. I'll appreciate any information or tutorials, videos etc. that anyone can link me to in terms of coding and their core foundations and reasoning behind its basic principles. Just the silly things that nobody bothers to elaborate on as I explained above.


How exactly are video games made?

22 June 2013 - 03:37 AM

I'm hearing a lot of the same thing when it comes to this topic and it seems most people are pretty confident and in the same mind. So I can't help but think I must be missing something pretty crucial if I can't seem to rationalize the very concept that an entire community keeps talking about. I suppose this confusion comes from one primary basis, which is, how do you translate code into an interactive environment?
So I keep hearing, that people design models in Blender or draw them for use with animation, then they'd download some shaders and use Dynamic Link Libraries with all that support to examine and configure the input/output. I've heard it all.

What I don't understand is that there is a huge gray area in between where I am at now, and how any of that works. Truth be told, I could go and purchase Unity3D right now if I wanted to. Heck, UDK engine is free as long as 25% of revenue is handed back to Epic. I'm sure I could thrive off of that crap if I had the determination but I want to start from the basics and the reason I am doing this is because I want to understand the basics. I want to know how I got there. Not download an engine and have the fish handed to me, I want to learn how to catch the fish myself. Get it?

 

Here's my problem, then.

I've decided to use C++ (no, duh?) and I'm finding it to be typical in terms of Object Oriented Programming. That's great. I've learned all the basic concepts and I intend to keep learning before I even attempt to make my crappy spin off of Pong - but before we even go there, I want to get some answers on where you'd have to take the language to get that kind of interaction up on screen.

 

So far I've been learning about if statements, arrays, classes, variables, operators - all the noob jazz. If I want to get something up in console I'd just type cout << "Hello world!" << endl; in one of the statements in my main function and then return 0. SUPER simple stuff, I know. What I'm having trouble understanding is how I can go from typing text into a console, and using this exact same language to render graphics onto a screen and have characters move around. Let's say that I wanted to remake the original NES Super Mario's first level (no way I'm doing this, but hypothetically) in C++. How do I draw up a graphic of Mario with a running animation, add in a background and put in my static objects, and then interact with them. It looks good on paper to make all these objects and classes but I don't know how the hell you'd get there.

Can we really talk on the most basic level? Can someone explain this gray area to me? What steps does someone need to take to get from displaying text on a console to displaying interactive images such as Pong? To type "Game Over" would I still use the cout << "Game Over" << endl; statement or something completely different? Would I just call another class which tells it to position the text in the middle of the screen and in a white, ASCII font? I'm so confused and I can't even fathom how you'd get 3D graphics on screen with textures and enemy AI if I can't even grasp this concept.

Really, as I said. I just need a basic explanation, dumbed down as much as possible to its core foundations of how a programming language such as C++ displays images on a screen that a user can interact with in full functional environments. Even if it's just something like Pong, or the original Mario, or Donkey Kong. Really, really basic stuff.
 


PARTNERS