Jump to content

  • Log In with Google      Sign In   
  • Create Account

Josh Petrie

Member Since 11 Jun 2003
Online Last Active Today, 01:16 PM

#5298248 why that i get a signal SIGSEGV with my Multithread code?

Posted by Josh Petrie on Today, 09:38 AM

Actually no. Nobody can advise you, because you're just wasting their time. Your earlier thread was a problem description of almost exactly the same level of detail, and you were prompted several times to provide clarifying details related to what your debugger tells you about the problem, and you didn't. Either because you don't know how to use your debugger or because you're willfully ignoring it expecting other people to do your work for you.


Learn to use your debugger, please. 


Once you've got a basic grasp of it, you may re-post your question provided you also describe in detail what the error is, where in your code it occurs, and what else your debugging has told you. Simply providing massive code dumps and asking "what is wrong with my code" over and over isn't really acceptable and takes advantage of the rest of the community.

#5297479 Converting a desktop game into mobile game- Illegal?

Posted by Josh Petrie on 21 June 2016 - 12:28 PM

Now my question is, can I take any game which is available on a desktop gaming sites like miniclip.com, addictinggames.com, poki etc. and convert it into a mobile game?



That depends what you mean by "take" and "convert."
If, for example, you're going to use any of the intellectual property of that source game, then no, it's not (generally) legal to do so without permission of author of the IP. So you cannot use their artwork, sounds, binaries, source code, et cetera. You may not use names, logos or other trademarks. 
You can create a game that uses similar mechanics; you can create your own version of a connect-four or match-three game. You can't take and port somebody else's stuff without asking them though.

#5296886 Is C++11's library a magic bullet for ALL multicore/multithread programming?

Posted by Josh Petrie on 16 June 2016 - 08:26 PM



Nothing is a magic bullet for all classes of any problem domain. Especially something design to be fairly general purpose, like a good chunk of stuff in the C++ standard library. Specialized libraries and solutions will always exist for niche scenarios and they will often be able to outperform in those niche scenarios. You will need to profile and analyze to be sure; you haven't provided enough information about your specific problem domain.

#5295645 what is scene state set

Posted by Josh Petrie on 08 June 2016 - 11:02 AM

It's hard to say without more context, but you're probably talking about the collection of rendering API state required to draw a scene. Your rendering API is generally OpenGL or Direct3D, and the "state" refers to all the various things you can configure or twiddle in the rendering of a scene. This includes but is not limited to:


- which shader is active at each stage of the pipeline (vertex, geometry, fragment, et cetera)

- which textures are active

- which buffers are active

- how blending is configured

- which color, depth, stencil, et cetera writes are active, and which related tests are active

- which target or targets to render to


and so on.

#5295408 Overloading new

Posted by Josh Petrie on 06 June 2016 - 08:49 PM

And what I get is " 'allocator' ambiguous symbol " as an error, what am I doing wrong? 



You created a type called "allocator" in the global namespace. However, you appear to have committed the cardinal sin of employing a using declaration ("using namespace std") in a header file (I can tell this because you wrote "typedef vector" instead of "typedef std::vector"). That means your "allocator" conflicts with standard library's "allocator."
Rename your type or (better), remove your using declaration.

#5295352 Using game graphics from old games

Posted by Josh Petrie on 06 June 2016 - 02:36 PM

Do these games come under any legal pressure when they are released?



Assuming they're using that artwork without properly licensing it, they are breaking the law and can face legal consequences.


Do they actually behind the scenes license these graphics from their owners?



Yes, this happens, although I don't know anything about the specific games you referred to.



If not, why don't these games come under any legal pressure despite the fact that they are using all graphics that they do not own.



Because humans are involved, and humans can miss things. Or maybe they simply haven't taken action yet. Or maybe they took action and everything was quietly settled. Or they took action and it was determined to not actually be an IP violation, or a copyright violation covered under fair use. It's impossible to say, anything can happen.
And finally, will my game be able to use these old graphics or will I need to ultimately hire an artist or artists to replace all the sprites in my game?


You cannot use those graphics without permission. You will need to hire an artist, license those graphics, license some other graphics, or make your own.


If I do require a license, is it actually possible for me to acquire a license to use these graphics?  What if I cannot even find the current owner of the graphics I am interested in using?  What if the owning "entity" as a whole no longer exists?



You have to try to track down the appropriate business people. It's possible an IP lawyer can help you here. It's very possible it will be difficult or impossible to even reach the correct people, especially given your position, and in that case you will have to settle for not using the graphics. If the original entity that held the copyright no longer exists, it's almost certain the rights to that IP reverted to an individual or were sold at auction (e.g., when 38 Studios went under) and you'll have to track down that person or entity.
It's not going to be trivial. Using your own graphics, whether made directly by you or by somebody you contracted with, is probably easier.

#5295300 Overloading new

Posted by Josh Petrie on 06 June 2016 - 11:17 AM

Thanks for quick reply, so every time I push an element vector calls new? Is there any way I can get it to allocate memory in one shot in the beginning then or do I have to write one? 



You can use vector's "reserve" member function to tell it to reserve enough capacity for a specified number of items. That will cause it to make only a single allocation (until you try to insert more than that capacity into the vector, and it must expand).
You're still going to have the same problem though. You will need a custom allocator for that vector (or you'll need to not use a vector here)

#5294858 Do I need to know Algorithms and Data Structures?

Posted by Josh Petrie on 03 June 2016 - 02:54 PM

No. Keep reading the book, but keep trying to make Tetris. Just don't look at other people's code. Do it yourself, think through the problems yourself. 


If you get stuck and have specific questions about something you can't figure out how to do, make a new thread here asking about them; explain what you want to do, show what you tried already, and talk about what you're stuck with.

#5294840 Beginner | Survival , DayZ style game

Posted by Josh Petrie on 03 June 2016 - 01:09 PM

You absolutely do not need to spend money on any software at this point in time. The freely-available versions basically everything will offer far more capability than you are ready to utilize so far.


(Edit: Also, I shrunk the text size of your signature to somethign more reasonable; we really don't like signatures that distract from the posts themselves here)

#5294817 Beginner | Survival , DayZ style game

Posted by Josh Petrie on 03 June 2016 - 11:27 AM

I would never recommend C++ as a first language. If you already know it, or already spent more than a few weeks learning it, continue doing so... but if you haven't I don't think it's the best option. The language is very firmly entrenched in the idea that you already know what you're doing; it can be very slow going for a neophyte compared to other alternatives.


Unity would be a good choice, as it uses C#, which I think is a far better language to learn first. Unreal would also work well though; it's Blueprint scripting mechanism is extremely powerful, especially for prototyping new gameplay ideas. However outside of Blueprint your only real extension mechanism is via C++, and in particular I don't think learning C++ through Unreal is a great idea (because Unreal implements a garbage collector and wants to impose certain paradigms on your use of C++... these can both make it easier to pick up on C++ and harder to learn actual C++ as opposed to "C++ in the context of Unreal"). 


Try both out and pick the one you like better. You could also forgo Unity and Unreal and build the whole game yourself, however this will require significantly more up-front investment on your part in learning how to program and in building multiple smaller games beforehand. If your really jazzed about making this game you envision right now, something like Unity or unreal is probably a better bet.

#5294797 Do I need to know Algorithms and Data Structures?

Posted by Josh Petrie on 03 June 2016 - 09:30 AM

You'll need to know about many basic algorithms and data structures, yes. You probably don't need to stop what you're doing, get a book, and read it before you move forward with making more complex games though. You can learn about them concurrently while you continue to develop games. You also don't need a book to do so, you can find very good information online, but a book may help focus you or may be a better way for you to learn.

#5294795 Pros/Cons of coding alternatives to std::algorithm?

Posted by Josh Petrie on 03 June 2016 - 09:23 AM

About the data structures, alot of times I will need data which I can access by some name or id, but where I really only care about the value when looping over it.



The point I'm getting at is that a std::(unordered_)map may not be the best choice for that. You have to look at those two access patterns -- lookup by key, iterate over collection -- and evaluate which needs to be faster. In games it's usually the case that you iterate over an entire collection of things far more often than you look up individual instances by some key. None of the associative containers in the standard library are particularly well-suited to iteration, they don't store their elements contiguously.
So if it is the case that iteration performance is more important, you can instead store the items in a contiguous container like a vector, and use a map only for mapping from key to index into that vector. That's what I'm getting at by suggesting that having to frequently iterate a std::map is often a sign you could make a better data structure choice.

#5294784 Pros/Cons of coding alternatives to std::algorithm?

Posted by Josh Petrie on 03 June 2016 - 08:30 AM

There is nothing wrong with writing your own traversal algorithm if the ones provided by the standard library don't work for you.

Personally I've never been a fan of the "for_each" algorithms, preferring the languages for loop constructs (especially range for) instead. But that's your call.

I would suggest however that if you find yourself looping over "each value" in a map so often that you think you need to write a utility function to do... Perhaps you have chosen the wrong data structure?

#5294722 Building a game like "Game of War"

Posted by Josh Petrie on 02 June 2016 - 04:51 PM

I feel like we've reached the end of the productive discussion we're going to have here.


Good luck with your project.

#5294653 Building a game like "Game of War"

Posted by Josh Petrie on 02 June 2016 - 09:33 AM

I think we've successfully beaten the "you're underestimating this" horse at this point, and I don't think we need to belabor the issue further.


As for the OP, if you are interested in recruiting a team, post in the Classifieds section. Recruiting isn't permitted in the forums, and most people who browse and read the forums aren't doing so to find projects to work on. People interested in finding projects browse the classifieds.