Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 30 Dec 2000
Offline Last Active Yesterday, 11:37 PM

#5193181 Question with regards to my video game

Posted by nobodynews on 16 November 2014 - 08:55 PM

A lot of this depends on how realistic you want the game to be. If you want it to be very realistic you wouldn't even give the player the ability to hold 20 weapons in their inventory. It would be more like Gears of War style where you can hold a few guns and those get 'stored' on the character's back in designated spots when not in use. Less realistic methods would just draw the currently held weapon and ignore the 'inventory' entirely, unless the user is in a menu where they can see all items in their possession. This would be more like Fallout 3 (and newer). The only impact having a large inventory has in the Fallout universe is at a certain point the player would slow down if they had too much stuff.

If you're asking how this is handled from a programming perspective: it's whatever the programmer decides. Nothing is ever drawn to the screen unless the programmer accounts for it. Where do the 20 weapons go? No where. They are just a small list of data. Its similar to a shopping list in that it's all just references to the real thing... or in a game's case, references to the model and animation.

So for merchants if you have weapons you'd need to come up with the right lists. If you don't want all their inventory out at all times you have to decide what weapons you want out, when. These lists might be as simple as text files. Formatted properly, the programmer can interpret them so the game decides when the merchant can display them.

Hope this helps a little. Without more specific information it's hard to tell what you're looking for.

#5193030 Best Way to Learn 3D Computer Graphics? Help!

Posted by nobodynews on 15 November 2014 - 04:28 PM

I think most likely they meant "personal". I could see how a non-native speaker might use "private" instead of the more apt "personal". Or even a native speaker just having a brain-fart.

#5192457 Building A Game Engine + Game

Posted by nobodynews on 12 November 2014 - 12:44 PM

Call me old fashioned, but only wimps have to rely on an engine

You're old-fashioned. Seriously though, no need to resort to name calling. No one insulted you, they were just disagreeing. You don't serve your arguments very well by being so judgmental of people who do it differently than you would. As for Tim Sweeney, if he came to me back in day saying he had no experience programming and he wanted to make a game engine I'd have said "what's a game engine?" because they didn't really exist back then. Tim Sweeney got where he is by being into programming a young age and working on it for years and making more and more complex games as he went on. Back then just making a text based game was impressive because that's all anyone was making. It's easy to be enthusiastic when you have little competition and expectations were low from consumers. Not to mention he had been into computers and programming for around 20 years before Unreal was released. All that being said I think the 'build a kitchen' analogy was weak. A better analogy might be growing your own ingredients to be a chef. Believe it or not there are chefs who do this! But I wouldn't call a chef who doesn't do that a 'wimp'. I think it's macho posturing to insist there's one true way to make games and those who don't do it that way aren't good enough. If the OP wants to make engines I say go for it and if they just want to use Unity go for that too and if they start one way and switch later because they realize they'd prefer the other way, I say go for that too.

#5189816 Finished c++ primer plus and console. Now I want to make a 2D tile game!

Posted by nobodynews on 28 October 2014 - 04:29 PM

Far be it from me to tell someone who *wants* to learn Win32 to not learn it, but for a beginner who wants to make a 2d tile game? Using something like SDL or SFML makes about 10x more sense than Win32.

#5189437 Questions from a newcomer

Posted by nobodynews on 27 October 2014 - 10:36 AM

You'll have to be a little more specific. What would your role be in the creation of that kind of game? Do you want to be the lead who guides a team of people in making a game of that style/scale? Do you want to be the guy that figures out the technology behind the scenes on how to display the graphics? Do you want to be the guy that decides what those graphics looks like? Do you want to write the storylines the player experiences when playing the game? I'm guessing you want to be the visionary since you indicated you wanted to create the game rather than saying you wanted to just work on making a game for someone. Usually the lead person comes about because they either helped someone else with their games or because they made their own games. Either way you need skills applicable to the creation of a video game. These are of course usually either programming or artistic roles. Of course it's never a bad idea to know a little about programming when you're an artist or a little about being an artist when you're a programmer. If you want to go the programming route you should pick up a programming language (there's plenty of topics about that). If you want to go the artistic route you could look into modeling programs such as Blender and find modding communities for games you like so you can show off your skills as you learn how to model, for example. In any case you want to make a portfolio of completed projects. "Here's what I was able to program!" "Here's what I was able to draw!" "Here's what I was able to model!" For programming you'll likely progress from making text-only programs to 2-d graphical programs to 3-d programs. You'll learn mathematics such as trigonometry and linear algebra as you go along. Hopefully some of that is helpful.

#5186522 where are the 4 addresses of an integer

Posted by nobodynews on 12 October 2014 - 12:01 PM

What language? Probably C or C++, but I don't like being a mind reader. I believe you are trying to ask how to get the memory address of each memory element (call it a byte) in an integer, assuming that integer uses 4 bytes to compose that integer. I say "assuming" because, although it is common for int to have a size of 4, it isn't guaranteed to be. Since this sounds like homework I'm afraid I'm not going to directly answer your question. Instead, I will point out that you should consider the address-of operator operator, '&'. Once you know the address of a variable, do you know how to get the following address of that int? It would be 4 bytes following, right? What if you had 'char n' , got the address, and then got the following address? It would be 1 byte following, right? Is there a way you can get the address of an int and treat it like you got the address of a char?


Hopefully by understanding the answer to the first question the answer to the second will be easier to comprehend and answer.

#5186519 how to redimensione (ReDim) an array in C++

Posted by nobodynews on 12 October 2014 - 11:50 AM

You don't; not directly. You use std::vector.

#5186517 Rotating point around point in 2D

Posted by nobodynews on 12 October 2014 - 11:45 AM


I take this opportunity to plug complex numbers


Are you using complex numbers because they happen to be a pair of floats/doubles, or is there something about complex numbers that make them well-suited to this use? I'm rather ignorant of math. How is typedef'ing a std::complex better than typedef'ing some other kind of two-float class?


If you look at rotate_around_center Alvaro utlized the properties of complex numbers to achieve the rotation. The only use of trig was in capturing the initial angle of rotation as a complex number. You may be interested the article AVisual, Intuitive Guide to Imaginary Numbers.

#5177046 SDL Memory Leak

Posted by nobodynews on 30 August 2014 - 05:45 AM

You have two calls to SDL_CreateTextureFromSurface but only one call to SDL_DestroyTexture.

#5171412 multiple source files and global varaibles.......................

Posted by nobodynews on 04 August 2014 - 09:10 AM

My problem is with my global variables which I was trained to utilize the most.

I'm curious what you mean by this. I've only heard train and globals used together when saying you should train yourself to not use them.

#5169646 Do GL and DX 'go through' the Windows GDI?

Posted by nobodynews on 27 July 2014 - 07:52 PM



In Windows Vista, all Windows applications including GDI and GDI+ applications run in the new compositing engine, Desktop Window Manager which is built atop the Windows Display Driver Model.




Direct3D 9Ex, Direct3D 10, and Direct3D 11 are only available for Windows Vista and newer because each of these new versions was built to depend upon the new Windows Display Driver Model that was introduced for Windows Vista


So, for at least Windows Vista and newer operating systems, GDI and DirectX are built on top of the Windows Display Driver Model, DirectX more directly. I'm not sure what Windows did before Vista, but I'm almost 100% certain DirectX bypassed GDI.

#5167522 C++ smart pointer usage

Posted by nobodynews on 17 July 2014 - 11:29 PM

I'm not sure what you did that 'broke all of [your] functions that had that vector being passed in', but you should be able to just pass in the std::vector of std::unique_ptrs as a reference. I tested it to be sure (and utilized typedefs; I'd suggest doing the same if you'd like fewer nested brackets):

#include <iostream>
#include <memory>
#include <vector>

class Planet
    int X;
    int Y;

typedef std::unique_ptr<Planet> Planet_ptr;
typedef std::vector<Planet_ptr> Planet_vctr;

void Function1(Planet_vctr &alteredVector)
    Planet_ptr p(new Planet);

    alteredVector.push_back( move(p) );

void Function2(const Planet_vctr &constVector)
    if (constVector.size())
        std::cout << "Not Empty!\n";
        std::cout << "Empty!\n";

int main() {
    Planet_vctr aVector;

Without delving into how you're using the pointers, I wouldn't be able to offer a suggestion on whether to use unique_ptr or shared_ptr. I found this explanation from Stack Overflowfairly coherent that might help you.

#5159360 remapping the keyboard (esp {} () )

Posted by nobodynews on 09 June 2014 - 04:39 PM

if you dont like to answer me dont answer not a problem, byt do not spamm me with useles and not interesting pseudo- philosophy

If you don't like the answers you get not a problem, but do not spam the boards with useless and not interesting pseudo-philosophy yourself. You could just as easily ignore answers that you don't like, but instead you're wasting your time arguing with people about how they shouldn't respond as they see fit because you want to ask questions as you see fit. IMO that's kind of hypocritical of you.

#5148617 Need help with installation of program

Posted by nobodynews on 21 April 2014 - 04:15 PM


I didn't even think about the permissions. I was having the installer put it into the program files folder in the windows directory. Could I perhaps have the program write to the public folder in users? If so would the following statement be correct?:


What you really want to do is query windows for the appropriate path to use. Look into using the function SHGetKnownFolderPath with a KNOWNFOLDERID of "FOLDERID_Documents". Then you'll for sure use the correct path for each user instead of hoping its what you expect.

#5147742 How to stop users from manipulating Game Save Data

Posted by nobodynews on 17 April 2014 - 04:00 PM

Does it mean to parse each character of the textfile to be a 1 or a 0?

It does not mean that. It means instead of having a text file you write the data in machine-readable form instead of humanly readable form. Consider, say, a .jpg file. That is an example of a binary file. I'm not a java programmer, but I found a small tutorial on how to do binary file i/o here that might help you.