Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 18 Oct 2005
Offline Last Active Yesterday, 10:03 PM

#5163457 Cross Platform C++ Database library?

Posted by SimonForsman on 28 June 2014 - 09:53 AM

I see your point regarding security. I'll go with the server and add a little encryption between the client and server. But still, how does one get hands on the MySql source? I followed the links, tried with Bazaar, no success!


The mysql source can be found here:



Select "Source code" as your platform to get the source code (Same thing goes for all the connector libraries etc, just select source code as your platform if you don't want a binary package)

#5163157 How to download a website as ms word with the pictures inside

Posted by SimonForsman on 26 June 2014 - 10:43 PM

You should probably be aware that a html document that you give a .doc extension is still a html document, not a word document and thus it can't include images (it can link to images but those images will have to be downloaded separatly) (Other office suites might also have trouble opening those files as they won't be in the expected format)


A far better solution is to actually generate a word document using for example: http://phpword.codeplex.com/ (It is very easy to use)



If you absolutely insist on using renamed html documents you will have to make an archive (zip for example) containing all the required files (images, stylesheets, etc) or to use data uris (<img src="data::image/png;base64,{base64encodedimagedata}"/>) but i don't know if word supports those. (it might work in newer versions of word (Microsoft added partial support for it in IE8 and made it semi decent in IE9)

#5161593 Question for Experts, especially for Beginners: Motivation, how NOT to lose it?

Posted by SimonForsman on 19 June 2014 - 05:13 PM

Okay, a big question to everyone who has produced a successful game (I'll let you decide what "successful" means).

How do you NOT lose Motivation?


Simple question, but I know the answer is probably complicated. I have learned many programming languages, many programmers go to me for help. But I actually have a problem staying motivated on a project!! So, for all you experts out there, how do you manage to keep your motivation, at least long enough to finished a half decent game?!


I'm sure I'm not the only programmer, beginner or not, who has a tough time staying motivated and on track making a game!


Looking forward to your answers, and I really hope this will help other programmers, beginners and not, to learn a good way to stay motivated!


Keep the scope small and don't work alone (Its far more fun to work with friends)

#5160132 Tips for a Beginner

Posted by SimonForsman on 12 June 2014 - 02:53 PM

So ever since I was around 12 I've wanted to make Video Games. Not stuff like FarmVille or stuff similar to that, but an actual game with a story and such. Well I'm 17 now, and I feel like I'm way too late to start learning how to program. 


Basically, I just need to know if I'm too late to get into Game Development and if not, some direction on where I should start. 


Maybe some general information on what I should know getting into this, and how to motivate myself to actually follow through. 


Also one more thing, do you need a fancy degree and a lot of education to get into the industry? Like, I'm not completely opposed to working for a big company, but I'd rather do stuff my own way. So any information regarding Education, and whether or not you need a degree and stuff would be helpful!





It is never too late or too early to learn something.


Getting a degree can make it easier to get your first job but its not strictly required. Most companies will pick the guy with a degree over the one without a degree if everything else is equal but in the real world everything else is never equal, a solid portfolio will blow most fresh graduates out of the water.


I would recommend getting some education though(even if you don't complete a proper degree), it can be very difficult to catch up on your own and if you are going to work full time with something else while learning and building a portfolio it will be even harder.

#5159004 Drastic performance loss

Posted by SimonForsman on 07 June 2014 - 08:36 PM

are you doing an optimized build ?


You are creating new arrays on the stack on each function call (create them outside the function and pass them by reference)


It is also a good idea to move the clientstate calls outside the function, enabling and disabling things isn't free and you seem to be doing so for each tile you draw (even though all tiles seem to have vertex array and texture_coord array enabled)


if you are drawing rectangles only you can use a fixed square vertex array and only re-bind the texture coordinate array for each tile to further speed things up. (you can change the shape and size of the rectangle  by scaling it)

#5158923 writing own graphics api or library

Posted by SimonForsman on 07 June 2014 - 11:08 AM

I knew they are constructed like wrote code almost all graphic cards can read them.

but i really dunno they can read instructions of almost all graphic cards.

is this idea right?


1. applications use library or api > library or api use common instructions for almost all graphic cards > video drivers > graphic cards




2.  applications use library or api > library or api can use instructions of almost all graphic cards with video drivers > graphic cards


if 1. idea is right, how do I learn common instructions? or 2.idea is right, can i use huge instructions with knowledges for almost all graphic cards.


I reallllly want to know that ...wacko.png


There are no common instructions (atleast not between manufacturers and GPU generations and most of the low level documentation is proprietary).

OpenGL and Direct3D both specify an interface that the GPU driver has to support and it is then up to the GPU manufacturers to implement support for those APIs in their drivers.


If you make your own low level API you will have to write your own drivers for every single GPU you intend to support. (or somehow convince Intel, AMD and nvidia to support your API)

#5158848 Homing missile problem

Posted by SimonForsman on 06 June 2014 - 10:41 PM



an API that uses degrees (which is a bad thing)

Yes, SFML has this problem. Hundreds of conversions needs to be made every frame which will in turn be converted back (to radians) in order to pass on to OpenGL.


Actually, glRotate also uses degrees, so maybe SFML and SDL are just trying to be transparent here and OpenGL is where the nonsense stems from. The only thing glRotate can possibly do with the angle is compute its sine and cosine. If it were up to me, OpenGL would allow you to pass in the sine and the cosine, and if we wanted to have a version that takes an angle, it would be in radians.



Well, glRotate belongs to the old transformation stack which is depracated, these days you can (and should) pass whatever it is you want to pass directly to the shader.

#5158769 Is there any way to generate a word doc from a html file

Posted by SimonForsman on 06 June 2014 - 01:50 PM

with html you can't.


You can however do it using PHP, Python, C# or some other programming language on the server backend (There are plenty of libraries around that lets you generate word and excel documents (primary in the newer .docx and .xlsx formats)


C#: http://www.codeproject.com/Articles/660478/Csharp-Create-and-Manipulate-Word-Documents-Progra

PHP: http://phpword.codeplex.com/

PHP (alternative library): http://www.phpdocx.com/documentation/tutorial

Python: https://pypi.python.org/pypi/docx/0.2.4

#5157864 Model Copyrights

Posted by SimonForsman on 03 June 2014 - 10:50 AM


I have a question to ask, i guess this is the right place to do so.
I am developing a 3d game and want to use characters from another game. I know that this is a copyright infringement so I plan to modify them. The question is , where does a character in the process of modification reveals himself as another character, or, how much modification should I do so that any resemblance cannot be considered copyright infringement
For example, If suppose the original models are green and have short hair, and i make them blue with green and big noose, is that ok from the point of copyright law?



If you base your model on an existing model then your model is a derivative work, if the original work is protected by copyright you will need a license that gives you permission to do whatever it is you are going to do with it, regardless of how big or small your changes are.


If your changes are big enough to make your own work unique it will also be protected by copyright (so others who also get permission to modifiy and distribute the same original work can't legally make the same modifications you did).


Making really extensive changes can make your crime harder to detect but it doesn't change the legality of the issue


There are plenty of permissivly licensed humanoid models (and even permissivly licensed motion capture data for humanoids) available that you can use as a base for your own work, use those instead.

#5157579 Programming for software intermingling(?)

Posted by SimonForsman on 02 June 2014 - 11:55 AM

I would consider myself intermediate in the strictest terms. I've never used c++ to control other software so that is the most difficult portion I see. As of all this back and forth, 'Api's' was the word I apparently was looking for lol. Learning the correct Api's will be my focus moving forward. Any good resources for Api's through c or c++?


The documentation for whatever API you intend to use tends to be a good start.


From what i understand you don't actually need to "control" other software though, it sounds as if all you need to do is read the contents of those .dat files and generate new files based on their contents.

#5157058 code flow (order) here

Posted by SimonForsman on 30 May 2014 - 05:00 PM

Allright, tnx, I will answet to it toomorrow (need a bit of thinking)

but i could ask yet one thing i do not understand in meantime


in oncreate in activity there is a line (80)


pongView = (PongTimeView)findViewById(R.id.pongview);


I do not understand this, pongView is an large object how you can just assign something to a large object - i would understand assigning something to a field of that but to a whole object - what is assigned here? does such assigning overvrite the left side, I mean previous state of an object - this line is strange to me; Can someone answer that?

(soory for font thuis changed after paste and i see no easy trick to change font tonormal)


pongView will store a reference to the view returned by findViewById. (R.id.pongview is a resource identifier so the view is most likely generated from an xml file)

if pongView allready had a reference to some other object the old reference would be dropped. (in this case that code should only run once when the activity starts).


consider this example


MyClass a = new MyClass();
MyClass b = a;
//Now a and b reference the same object.
a.someMember = 5;
System.out.println(b.someMember) //This will print 5 since a and b are the same object.
b = new MyClass(); //now b will reference a new object, a is unchanged.
b.someMember = 10;
System.out.println(a.someMember) //this will print 5 since a and b are different objects now
a = b.Clone(); // this creates a copy of b and assigns its reference to a, the original object referenced by a is no longer referenced by anything and will be garbage collected eventually. (Most standard library classes implement the Clonable interface)
System.out.println(a.someMember) //this prints 10
b.someMember = 15;
System.out.println(a.someMember) //this still prints 10 since a and b are different objects now.

#5156823 android fluid frames and gc

Posted by SimonForsman on 29 May 2014 - 03:08 PM


Since you didn't post any actual code it is hard to give a proper answer but.... yes, when you make games using Java(and other languages with a hard to control GC) you want to write your code in a way that keeps the GC from kicking in during gameplay. Hold on to your references, re-use allready allocated objects instead of reallocating them, avoid modifying immutable objects(such as strings) and try to do your cleanup (drop references and force the GC to run) during your loading screens,


Isnt this something you do against the language? Im a bit schocked. Is it really possible to not involve garbage collection in java? I mean it would be something like c style writing in java ;/


I understand that procedural c-like way of writing in java on android is impossible because of heavy objective api, or this is also possoble?


(sad I got no experience here, come from couple of years in pure c/winapi world, maybe I will learn something about this very crazy world of android this year ;\)


PS as to source i just wathing some very simple random pice of android game code 




and trying to get know what is going on here; 

If someone would like volountinery explain me a bit what is goin on here it would be welcome too...



No, its not possible to "not involve" the garbage collector, but it is possible to keep it from running when you don't want it to run. (The GC will not run(or will atleast run really really quickly) if there is no garbage to clean up) and you can coax the GC to run when you want it to run (By asking it nicely and sleeping repeatedly until it runs).


That code being ugly has nothing to do with the GC though (for a simple game like pong the GC is irrelevant as you can create all your objects at startup and hold on to them until the program closes)

#5156530 android fluid frames and gc

Posted by SimonForsman on 28 May 2014 - 12:30 PM

Since you didn't post any actual code it is hard to give a proper answer but.... yes, when you make games using Java(and other languages with a hard to control GC) you want to write your code in a way that keeps the GC from kicking in during gameplay. Hold on to your references, re-use allready allocated objects instead of reallocating them, avoid modifying immutable objects(such as strings) and try to do your cleanup (drop references and force the GC to run) during your loading screens,

#5151567 How to get rid of black borders in full screen? (OpenGL/Win32 API)

Posted by SimonForsman on 05 May 2014 - 03:36 AM

Create the "window" using the desktop resolution (you can get this from Windows) and pass the desktop resolution to glViewport but send 800, 600 to glOrtho. (or use 800,600 to create your own orthographic projection matrix if you use modern OpenGL)

#5149722 How can i save an image without edges?

Posted by SimonForsman on 26 April 2014 - 04:29 PM

A) add an alpha channel and erase the background, save the image in a format that supports transparancy. (.png is fairly popular)

B) pick one color(magenta is popular for this) to use as "transparent" and filter it out in your engine.