|
|
Home » Community » Newbie corner » Simple way to develope 2D Game (Do Upp include something to develope 2D Game ?)
Simple way to develope 2D Game [message #51876] |
Tue, 11 June 2019 12:28  |
 |
Xemuth
Messages: 387 Registered: August 2018 Location: France
|
Senior Member |
|
|
Hello there,
Me and friends would like to develop a 2D Games.
And we're wondering if Upp include an easy way to develop 2D games with is TopWindowCtrl.
If yes, do you guys have an example more complex than 2DBox examples ?
Thanks in advance
Best regard.
[Updated on: Tue, 11 June 2019 14:06] Report message to a moderator
|
|
|
Re: Simple way to develope 2D Game [message #51879 is a reply to message #51876] |
Tue, 11 June 2019 16:02   |
Novo
Messages: 1430 Registered: December 2006
|
Ultimate Contributor |
|
|
Try to take a look at 2D games developed in Adobe Flash. Flash is providing 2d vector graphics.
U++ has similar functionality. Take a look at PainterExamples.
Flash is using such abstractions as timeline and frames, which you'll need to implement by yourself.
The rest is already available.
You can start by reading AS3 (Flash programming language) books. They describe such abstractions as Movie and MovieClip, and explain how to create animation.
Hope this helps.
Regards,
Novo
|
|
|
|
|
|
|
|
Re: Simple way to develope 2D Game [message #51892 is a reply to message #51889] |
Wed, 12 June 2019 02:20   |
Novo
Messages: 1430 Registered: December 2006
|
Ultimate Contributor |
|
|
mirek wrote on Tue, 11 June 2019 17:02It is however pretty hard, GPUs are not well suited for this, so the work was postoponed.
A couple of examples of what can be done.
Check this app. It is a Flash Player with hardware acceleration.
Try to run included examples.
Ctrl-W will show you how tesselation works.
F1 works as well.
It is compiled with MSVS 2008, but, theoretically, should work on any machine ...
ImGUI looks interesting as well.
Regards,
Novo
|
|
|
Re: Simple way to develope 2D Game [message #51894 is a reply to message #51892] |
Wed, 12 June 2019 09:19   |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
Novo wrote on Wed, 12 June 2019 02:20mirek wrote on Tue, 11 June 2019 17:02It is however pretty hard, GPUs are not well suited for this, so the work was postoponed.
A couple of examples of what can be done.
Check this app. It is a Flash Player with hardware acceleration.
Well, sorry for original poster for being off-topic... Anyway:
It all seems to depend on "this" in above quote. If "this" is defined as "reproduce the Painter polygon semantics with 90% accuracy", then it really is a problem and tesselation is at the heart of it, the other issue being batching / OpenGL state changes.
It simply might be less problematic to render polygon with 100000 vertices in software than to tessalate it, send all vertices to GPU and then render.
Even more trouble: As what I draw is often map polygons, I have even tried the tactics of: tesselate map polygon once, store it in the GPU and then draw from data in GPU. Guess what: This is still slower than software rendering, because by the time OpenGL is finished with state changes to draw the polygon, software renderer is already done with that. So it appears that as long as you are doing glDrawElements in equivalent of Painter::Fill / Painter::Stroke, you have already lost. Means ideally you need to do single glDrawElements for the whole rendering, less ideally but still useably single glDrawElements per many Fill/Strokes.
That said, I have it in "postponed" state now. For now, I got stuck at "I need faster tesselator than tess2, but at the same time I need tesselator that is as accurate as tess2". While there are faster tesselators (e.g. https://github.com/mapbox/earcut.hpp), they are not as accurate, trivial polygon examples tend to fail with them. I have tried to implement my own, but the work is still in progress...
Mirek
|
|
|
|
|
|
Re: Simple way to develope 2D Game [message #51906 is a reply to message #51902] |
Sat, 15 June 2019 18:58   |
Novo
Messages: 1430 Registered: December 2006
|
Ultimate Contributor |
|
|
mirek wrote on Wed, 12 June 2019 14:58
If you have any other suggestion...
(BTW, polygon rasterization of Painter is adopted from AGG. I feel no shame about it, because he in turn adopted it from FreeType 
Mirek
The only one I'm familiar with is from the author of AGG. Part of the algorithm is patented.
"he in turn" asked an author of FreeType for a permission and got it ...
Tesselator was completely 100% his algorithm and code.
mirek wrote on Wed, 12 June 2019 14:58What I argue about is that if you are about to draw very complex polygons with little pixels and draw a lot of them, with external API / semantics similar to Painter, then beating Painter is difficult.
Maybe, but "this" app is an example of exactly that.
Most of the GUI code is using semantics of Draw (DrawRect/DrawText/DrawImage). Painter-related stuff can be rendered into bitmaps in the beginning ...
But even ImGui, which is redrawing everything each frame seems to be able to handle this load.
I'm pretty sure you can do much better than that.
IMHO, with your talent to design very complicated things in a very simple way you should be able to do this easily.
Hardware Abstraction Layer, tesselator, display tree, immutable data structure to pass data between threads ...
It would be interesting to see how simple and elegant will be your design ...
Regards,
Novo
[Updated on: Sat, 15 June 2019 20:15] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Tue Apr 29 08:40:52 CEST 2025
Total time taken to generate the page: 0.03833 seconds
|
|
|