Jump to content

  • Log In with Google      Sign In   
  • Create Account

Chad Smith

Member Since 26 Jun 2005
Offline Last Active May 20 2016 09:31 PM

#5292569 Best Programming Language for Simple Multiplayer Sport Simulation Game

Posted by on 19 May 2016 - 10:10 PM

This screams like a web application to me.  


So for Client Side you will need really at the minimum JavaScript/HTML5 and some type of server side technology (storing your information in some kind of database, and maybe storing some other things on the server).


There are A LOT of JavaScript frameworks that can be used (I actually think there are too many frameworks), each one having their own pros and cons. And really for server side you could choose almost anything.  You mentioned Python and Python would mostly definitely be able to do it. Though from what I gather about what you posted I can see this type of game fitting inside a node.js app with maybe using MongoDB as the database

#5271001 When you realize how dumb a bug is...

Posted by on 13 January 2016 - 09:31 PM

happened yesterday at work:


Writing a quick file uploader for a web app. Put all my form inputs in place, get the section where you can drag and drop files in, write a few simple methods to return a list from the server to dynamically populate a drop down. Populate the drop down and....the drop down doesn't work? What? Why didn't it populated? Spend an hour looking for a stupid mistake in my code and going through documentation. Finally get irritated enough that I literally copy and pasted a hard coded example. Wait? Still doesn't work? The drop down isn't even registering my click event!?

Ask someone, he walks over and instantly sees that the section to drag and drop files was overlapping the drop down. I knew their was a reason I hated front end stuff. I'll stick to my server side stuff...wacko.png

#5261478 simple java question

Posted by on 11 November 2015 - 12:22 AM

i2 points to the same address as i does. so since i becomes "0", shouldon't i2 also be "0"?

In Java Strings are immutable. Basically there is nothing* that you could do to i that would affect the value of i2. They originally referred to the same object, the string "3." So it is a reference to an object, with "3" being the object. When you set i to "0" it just changes the reference, while the string object remained unchanged.



Note: I will be the first to admit that I do not program in Java. I am a C++ and C# programmer. I am just going off of what I believe I remember when I did learn Java. If my information is wrong I apologize. 

*I think you could use reflection to mutate a string (based off my quick research)? 

#5228247 Different GCC Versions Resulting in Different Output

Posted by on 10 May 2015 - 11:33 AM

Sounds wierd. I can't see anything wrong.


You are initializing l2TotalTries to zero, right?


What the...Ok, that is what I get for coding at 2 in the morning I guess. 

I saw that last night and said "ahh, that's the issue, DUH!" Though after I fixed that I could of swore I tried it again on both my Universities linux machine and my Windows machine with gcc and it still gave the wrong output.  Though after doing that again today, setting l2TotalTries to zero works, as it should, and not initializing it to zero doesn't work.


Which I do sort of understand. l2TotalTries would be just garbage data, correct? So I can either get the desired results, or the wrong results. It seems using Visual Studio in both release and debug mode gives me the desired results when it is not set to zero. My friends Mac Book Pro did the same thing. While my University machines just used garbage data, and compiled under GCC on my Windows computer also resulted it in it being set to garbage data.


Little odd that different versions of compilers and different systems did different things to that variable. Though I understand that is not covered in the standard so the results are unknown. Guess I see why you always initialize your variables. Though I still swear that I tried that last night and it still gave unexpected results. Though I can't repeat it today.


I guess lets just ignore this post now. I do feel pretty dumb for making a mistake like that now and not understanding it. *embarrassed* 

#5226836 Best comment ever

Posted by on 02 May 2015 - 09:46 AM

I always like the comments from sections of Code that are copied and pasted from old code or another project. Ran into that the other day at work. Comment said it did something, code did something else unrelated.

#5177793 Did I begin learning late?

Posted by on 02 September 2014 - 09:19 PM

Not even close too old.  Matter of fact, I'd say you are at the perfect age too.


I attend a University and I remember in one of my first Computer Science courses there was a guy in his 60's coming back to school just so he could learn programming.  

#5175310 Strange output when writing to a file object and printing it out

Posted by on 21 August 2014 - 11:14 AM

Honestly, I sort of feel this is why some people are afraid to post some questions or post in the For Beginners section.


While I completely understand and agree that seeing multiple questions from the same person that at first glance doesn't seem to be trying to figure out the issue before they ask the question can be a bit annoying and not programming.  I totally understand that.  Though I also feel that this is the For Beginners section and the one thing that is always advised to beginner programmers is to ASK if you have an issue to try to understand it.  I feel the advice was just fine but also feel the advice was presented in a very impatient manner and also in a manner that made it seem like it is a bother that they asked a question.


1: If you feel the question is a bother to you, then you don't need to answer it.  Allow someone else too.  If you're going to be impatient with a beginner trying to figure something out then I feel you're doing more harm than good.


2: Typing in all caps to get a point across to a beginner is rude.  Even if your advice is good and sound.  I feel its rude to try to get the point across to the beginner in all caps.  Again it feels like you're being impatient with them.


Again, while I completely agree with the advice I feel it was presented in a rather impatient manner, something I don't think we need when helping beginners out in the For Beginners section. 

#5172674 Good step-by-step development tutorials/books

Posted by on 10 August 2014 - 06:58 PM

They do have advantages:

  • They give beginners a good notion of all the required expertise when implementing a specific game
  • They give a good insight on different ways of tackling different problems (different devs, different approaches to game dev)
  • They give a good notion of what's required to implement a speicifc game design
The only ones that get that advantage are the ones who actually bother understanding the code in the tutorials. Unfortunately, the number of 'beginners' who are impatient and want to go from 0 to 60 now is steadily increasing.

Then that is a totally different argument and nothing to do with the actual content that he original poster is asking for. While I do agree with you, you will only get out of those tutorials by how much effort you put in. Though if you actually put in the the time and effort, like it seems the orginal poster wants to do, then those tutorials can be of great benefit.

I just think it's wrong to say those tutorials/content is bad for a programmer then blame it soley on the users of the content that doesn't put the time and effort in.

#5125159 Is HTML5 a legit language for developing game?

Posted by on 20 January 2014 - 03:37 PM


I sense someone didn't like Steve Jobs...

#5103585 Unmaintainable code

Posted by on 22 October 2013 - 10:31 PM

I'm not by any means a programmer that can go look at code and see some weird things (though looking at this code gives me nightmares like it seems it does to everyone else) as I really am just an intermediate C++ Programmer that does struggle with code design, but I saw this bit of code and something jumped out at me and I laughed for some reason.

if(id==0)OPENAL_SetPaused(channels[whooshsound], false); 

I saw that and I said to myself "so wait, now that you commented out that other if statement you just essentially put two if statements back to back that check the same thing?  Nice!"  lol.

#5103538 Unmaintainable code

Posted by on 22 October 2013 - 04:50 PM

It's like they got a ton of random programmers together, told them nothing at all and just said "code. Oh you also can't look or ever see what everyone is programming."


I hope theirs a suicide watch out on the person who has to maintain this code.

#5101966 How do you 'learn' a programming language?

Posted by on 16 October 2013 - 04:02 PM

really the best way to learn programming is to just code and keep coding.  You said you read something and you do the examples.  Ok good, but is that all?  I used to do the same thing and well I thought I knew all the concepts but I found later on when it came to applying them to a different program I hadn't really learned them.  Then what I started to do was create my own examples.  Ask yourself questions while reading.  While your reading try creating your own examples before you even get to your exercises in the book.  What you will end up doing is helping yourself understand this concept in a lot of different ways.  The ways/examples you do might not be meaningful or useful but that is ok.


Next after you do the examples in the book, try to extend on them and make them into a more "complete" program/example.


Finally if you don't understand a certain concept try writing it down.  Work through that concept on paper like the program would run it step by step.  Then put that concept into a program and use your debugging tools to attempt to run the program step by step.  Look at what values changed?  Why did they change?  Work that out on paper and compare the results.  If you are getting the same results on paper as you would get in the program then you're understanding the concept more.


It all comes down to, just keep programming.  Their will be concepts you don't get or understand right away.  Just keep programming.  We all need breaks and everyone here understands that.  Though in the end make sure you come back and keep programming.  When you come back instead of thinking that you have to reread everything try testing yourself on what you read previously without looking at your book.  If you keep doing all of this before you know it you will solving problems all on your on.


Just remember though we all need help sometimes.  Don't be afraid to ask questions.  Everyone here be it professional or not need to ask questions sometimes and we have all been there before and we all understand (ok their are a select few people I've noticed that do believe they are above everyone and think they understood everything first try, but ignore those people).

#5094759 C++ skips a statement in it's first run

Posted by on 17 September 2013 - 03:12 PM

string n_movie[n];
Or perhaps.....  
vector<string> n_movie;

What's the question? Is there one? Yes I'd use a vector but it is likely the OP hasn't studied vectors yet so an array is fine with him learning.

#5075864 std::move and std::unique_ptr

Posted by on 07 July 2013 - 03:41 AM

I'm pretty new to some C++11 and also smart pointers.  While reading and studying part of the bare bone basics of a scene graph I came across the following C++11 code.  Guess just wanted to make sure I am on the right track on what I believe is happening and just wanted some clarification.


Here is the function:

RemoveChild(const SceneNode& node)
	auto found = std::find_if(children.begin(), children.end(), [&] (ScenePointer& p) -> bool {return p.get() == &node; });

	assert(found != children.end());

	ScenePointer result = std::move(*found);
	result->parent = nullptr;

	return result;

Couple notes:

  • children is just a vector container.  It contains std::unique_ptrs of SceneNodes
  • ScenePointer is just a typedef of std::unique_ptr<SceneNode>


It's using the find_if algorithm to go through each element in the vector.  Uses a Lambda Expression to check if that elements pointer is the address of the node we are searching for (whew I need to study up more on Lambda Expressions I'm noticing).

It then uses an assertion to validate that the node we searched for could actually be found


It will store the result by just using the C++11 move semantics in std::move.  Because found is actually an iterator (I think?) I need to dereference it?


Then since it is removing a child we set the child's parent pointer to null then just use erase to remove it from the vector since it's not longer a child.  Finally return the detached node/smart pointer.


Am I close on this?  My main question is about the std::move(*found).  I understand hat this would actually be moving the content and won't require a copy of the entire object.  So that position in the vector is empty now, right?  My main question is: why exactly was the dereference needed here really?  


Thanks to any and to all who can give me the confirmation and help!

#5074947 learned c++, now what?

Posted by on 03 July 2013 - 12:17 AM

If you still interested in learning SDL then I would highly suggest the Lazyfoo SDL Tutorials.  These will get you started with SDL on your way.


On creating your game, the best way would be to just start learning/studying the API of your choice (seems to be SDL that you're interested in) then just start thinking about "ok, how can I get this happen?"  Then try designing and programming it.  Start from the most basic step of just getting a window up, then learn how to draw something to that window.  Learn how to get input, move it, animate it.  One step at a time.  Just keep building on it.


Also with you just starting here is what I suggest: at the starting point don't focus too much on perfect code or the best designed code.  I will go ahead and tell you something, that you might not want to hear.  Your code to your first game will look like crap.  Everyones code to their first game looks like crap.  Don't focus on trying to make it look good, professional, or 100% proper.  Just focus on getting your game made.  You will learn how to write well designed code in time and with experience.  Too many first games are never completed because they get refactored so many times with people trying to make the code "perfect."  Just write it and finish it.  When you do finish it you could even post the code and ask here for a code review.  Their are some very good programmers here that don't mind at all to do a quick code review and will give you some very good pointers.  One thing these programmers will always say though before they even start the code review is "congrats on finishing the game!"


So the LazyFoo SDL Tutorials: http://lazyfoo.net/

Also keep the SDL Documenation near you so you can study up on SDL that way also.  Then just program and try stuff out.  Start the most basic thing then move forward one step at a time.  Don't try to write the entire time right from the start.  One step at a time.


Also, if you are not too sure about SDL or are interested in trying something else out, I will throw out the suggestion of SFML.  I myself like the design of it better than SDL.



If you have any questions don't hesitate to ask.  99% of the time we will be very happy to assist you, as long as you have shown you have put some thought and work into it yourself.  As in we won't just write your game for you or anything like that.  lol.