Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to next message
Xemuth is currently offline  Xemuth
Messages: 59
Registered: August 2018
Location: France
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 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 817
Registered: December 2006
Experienced 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 #51880 is a reply to message #51876] Tue, 11 June 2019 16:26 Go to previous messageGo to next message
Xemuth is currently offline  Xemuth
Messages: 59
Registered: August 2018
Location: France
Member
Thanks Novo,

I will take a look up
Re: Simple way to develope 2D Game [message #51881 is a reply to message #51876] Tue, 11 June 2019 17:33 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 11892
Registered: November 2005
Ultimate Member
https://store.steampowered.com/app/872700/JetStory_2018/?cur ator_clanid=4777282&utm_source=SteamDB

is developed in U++ Smile

I plan to opensource it soon.
Re: Simple way to develope 2D Game [message #51883 is a reply to message #51876] Tue, 11 June 2019 19:02 Go to previous messageGo to next message
Xemuth is currently offline  Xemuth
Messages: 59
Registered: August 2018
Location: France
Member
Haha Mirek !

when I posted the subject, I was hoping you spoke about Jet-Story and how you did it!

I'm happy you planned to make it opensource Very Happy
By saying soon how mutch time you planned ? Rolling Eyes

[Updated on: Tue, 11 June 2019 19:05]

Report message to a moderator

Re: Simple way to develope 2D Game [message #51886 is a reply to message #51881] Tue, 11 June 2019 20:05 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 817
Registered: December 2006
Experienced Contributor
mirek wrote on Tue, 11 June 2019 11:33
https://store.steampowered.com/app/872700/JetStory_2018/?cur ator_clanid=4777282&utm_source=SteamDB

is developed in U++ Smile

I plan to opensource it soon.

I guess plugin/tess2 was added because of this game ...
When are you planing to release a brand-new hardware accelerated version of U++ GUI ? Rolling Eyes


Regards,
Novo
Re: Simple way to develope 2D Game [message #51889 is a reply to message #51886] Tue, 11 June 2019 23:02 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 11892
Registered: November 2005
Ultimate Member
Novo wrote on Tue, 11 June 2019 20:05

I guess plugin/tess2 was added because of this game ...
When are you planing to release a brand-new hardware accelerated version of U++ GUI ? Rolling Eyes


Actually not, but in general I am working on OpenGL accelerated Draw / Painter subset. It is however pretty hard, GPUs are not well suited for this, so the work was postoponed. Actually, probably postopened until I find a better alternative to tess2 Smile

Mirek
Re: Simple way to develope 2D Game [message #51892 is a reply to message #51889] Wed, 12 June 2019 02:20 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 817
Registered: December 2006
Experienced Contributor
mirek wrote on Tue, 11 June 2019 17:02
It 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 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 11892
Registered: November 2005
Ultimate Member
Novo wrote on Wed, 12 June 2019 02:20
mirek wrote on Tue, 11 June 2019 17:02
It 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 #51901 is a reply to message #51894] Wed, 12 June 2019 19:13 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 817
Registered: December 2006
Experienced Contributor
mirek wrote on Wed, 12 June 2019 03:19

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.

"this" is defined as an inspiring example of that 2D graphics on GPU is not just possible, but this was already done ~10 years ago. BTW, tesselation was developed by the author of the Anti-Grain Geometry.
It was a commercial project, but most of the problems you listed were solved.

Everything is possible. Rolling Eyes


Regards,
Novo
Re: Simple way to develope 2D Game [message #51902 is a reply to message #51901] Wed, 12 June 2019 20:58 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 11892
Registered: November 2005
Ultimate Member
Novo wrote on Wed, 12 June 2019 19:13
inspiring example of that 2D graphics on GPU is not just possible


I never argued about that. You can definitely do great things with GPU.

What 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.

Tesselation was definitely developed many times before. However, the only opensourced code I have really found is

- tess2. Slow.
- earcut. Does not correctly support winding semantics.

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 Smile

Mirek
Re: Simple way to develope 2D Game [message #51905 is a reply to message #51902] Fri, 14 June 2019 17:59 Go to previous messageGo to next message
Sgifan is currently offline  Sgifan
Messages: 37
Registered: February 2010
Location: France
Member
I know it is not mutiplatform, but Direct2D is really powerful and simple to use.

It is as capable as painter, antialiasing quality is perfect.


For instance look at this project to create something like painter using direct2d

https://github.com/livingcreative/kcanvas

https://raw.githubusercontent.com/livingcreative/kcanvas/master/demo.jpg

Look also here: https:// github.com/microsoft/Windows-classic-samples/tree/master/Sam ples/Win7Samples/multimedia/Direct2D

to have simple and small examples of using Direct2d in Win32 (not UWP, not WinRT)

I would even go as far as to say it could easily be used by SystemDraw instead of GDI on win32.

[Updated on: Fri, 14 June 2019 20:09]

Report message to a moderator

Re: Simple way to develope 2D Game [message #51906 is a reply to message #51902] Sat, 15 June 2019 18:58 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 817
Registered: December 2006
Experienced 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 Smile

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:58
What 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

Re: Simple way to develope 2D Game [message #51907 is a reply to message #51876] Sun, 16 June 2019 14:42 Go to previous message
Xemuth is currently offline  Xemuth
Messages: 59
Registered: August 2018
Location: France
Member
Hello Sgifan,

Thanks for your proposition, I will take a look Smile !
Previous Topic: [SOLVED] Lib Curl undefined reference
Next Topic: New system of feature requests on our forums- please read and use!
Goto Forum:
  


Current Time: Wed Jun 19 12:45:34 CEST 2019

Total time taken to generate the page: 0.00902 seconds