Remember to check out the work-in-progress FAQs: Trine 2 FAQ, Humble Frozenbyte Bundle FAQ. You can also contact us by email.

Shadowgrounds & SGS SDL-2 Source Port

Technical support for the Linux & Mac platforms (for Shadowgrounds and Shadowgrounds Survivor).

Shadowgrounds & SGS SDL-2 Source Port

Postby Draygera2 » Wed Feb 05, 2014 8:39 am (link to this post)

Hey all:

I don't know if anybody would be interested or not, but I've forked vayerx's Shadowgrounds repo and spent most of the last two days working on doing a basic straight SDL2 port (which means there are several bugs right now, the Readme hasn't been updated yet with what has to be done to get it to compile at the moment, and currently only Shadowgrounds compiles). Here's my repo (the commits are messy, but I plan on writing better ones as I fix stuff).

Now, mind you, I am amateur at C++ and am predominately a Java programmer (and still a novice at that - 2 to 3 years personal study with a couple semesters college credit in the basics). I can read code fairly well, though, and can figure out where things need to go.

From what I can tell from the SDL2 migration documentation, there are several things that could probably be rewritten altogether (or at least most of the way):

InputHandling - SDL2 uses scancodes which seem to be region free meaning that the current implementation, which uses unicode, is fairly obsolete and unnecessary.

SoundHandling - is openal really necessary? Could the new SDL2_mixer be used instead? (Maybe there's a major reason for openal, but it seems like the SDL_mixer could probably work just as well without having to have the extra dependency. Just my thoughts on the matter).

Rendering - currently it uses a custom renderer. Could this be updated to use the new rendering system instead?

There's probably other things that need to be worked on, but these seem to be good starting points.

Would anybody be interested in helping? My main goal is to get the game fully running on SDL2 and then try to port it to other crazy things. ;)

What do you all think about this? Feel free to leave your comments and recommendations below.
Draygera2
 
Posts: 10
Joined: Wed Feb 05, 2014 7:51 am

Postby Draygera2 » Sat Feb 22, 2014 5:39 am (link to this post)

Update: I am currently working on fixing the fullscreen and windowed-mode bugs. I have an idea of why they happen, but I've gotta do some testing first.
Draygera2
 
Posts: 10
Joined: Wed Feb 05, 2014 7:51 am

Postby Draygera2 » Wed Mar 05, 2014 6:29 am (link to this post)

Update 2:

So, I still have the Fullscreen bug - The splash screens show up at the proper resolution but the main menu stretches to that of the full desktop while the camera is set to the far right of the screen. I'm still trying to figure out why this is happening now. Most of the updates I made to the Storm3D class should not have caused this drastic of an issue unless something in the UI implementation and / or Storm3D_Scene class were written improperly. This is one of the main reasons I want to try to rewrite the rendering system to use more of the SDL2 functions wherever possible so that I can reduce the codebase that needs to be maintained and also figure out how Storm3D actually works.

So far, whenever the fullscreen resolution is set to higher than that of the Desktop resolution, the game defaults to the highest supported resolution of your monitor. When configured like that, everything (but some input issues that I'll get more into detail in a bit on), seems to work fine.

While I'm trying to figure that out, I'm also currently updating the Keyb3 class and its dependent code to use the new SDL2 Scancode and Keycode implementations wherever possible. So far, the menu can be mostly controlled with a PS3 controller when previously it didn't work, at least on the Linux platform. I'm still running into the bug where pressing Ctrl, Alt, or the Windows key completely segfaults the game, but I honestly have little clue why it's doing that when the pristine code doesn't have that problem at all. I'm thinking about emailing Ryan Gordon about it and see what his opinion is on it.

I'm about to merge my current code-base into my repo, and I'd like to find out if anybody else is having that same problem.
Draygera2
 
Posts: 10
Joined: Wed Feb 05, 2014 7:51 am

Postby Draygera2 » Tue Mar 25, 2014 5:11 pm (link to this post)

Added an issue tracker to my git. There are several updates and goals on it. Haven't had much time to work on this lately, but I still plan on working on it.
Draygera2
 
Posts: 10
Joined: Wed Feb 05, 2014 7:51 am

Postby Urfoex » Tue Mar 25, 2014 6:36 pm (link to this post)

Nice work!

PS: I'd love to see a port from nvidia physx¹ to bullet physics² :wink:

¹ https://developer.nvidia.com//gameworks-physx-overview
² http://bulletphysics.org/
+-----------------------------------------------------------------\
| Debian testing 64Bit on
| * AMD Phenom x4 905e (4x2500Mhz)
| * 6GB Ram
| * AMD/ATI Radeon HD4770 (fglrx)
+-----------------------------------------------------------------/
User avatar
Urfoex
 
Posts: 50
Joined: Fri Apr 15, 2011 11:14 am

Postby Draygera2 » Thu Mar 27, 2014 7:36 am (link to this post)

Urfoex wrote:Nice work!

PS: I'd love to see a port from nvidia physx¹ to bullet physics² :wink:

¹ https://developer.nvidia.com//gameworks-physx-overview
² http://bulletphysics.org/



Thank you for the response. Once I get Shadowgrounds actually fully working (since Survivor is definitely a secondary priority, at the current moment), that is definitely something I'd be interested in checking out. Like I said, I'm still working on it. I just have been busy with real life and work.

Since I'm off Friday, I'm thinking about tackling this enhancement. Got any suggestions for it? I've never done a git README file and if I update it with the new information that I've learned, it seems like it will fix a rebase issue I have when I try to update my code with vayerx's (I'm fairly new to git; I rebase the code - my SDL2 README file goes bonkers with errors).
Draygera2
 
Posts: 10
Joined: Wed Feb 05, 2014 7:51 am

Postby Urfoex » Thu Mar 27, 2014 5:14 pm (link to this post)

+-----------------------------------------------------------------\
| Debian testing 64Bit on
| * AMD Phenom x4 905e (4x2500Mhz)
| * 6GB Ram
| * AMD/ATI Radeon HD4770 (fglrx)
+-----------------------------------------------------------------/
User avatar
Urfoex
 
Posts: 50
Joined: Fri Apr 15, 2011 11:14 am

Postby Draygera2 » Thu Mar 27, 2014 10:50 pm (link to this post)

Thanks. I found those links after I made my post last night. :) Also, I added your suggestion to my issue tracker. If you have any otherssuggestions and a github, please feel free to try to submit them to my issue tracker linked above.
Draygera2
 
Posts: 10
Joined: Wed Feb 05, 2014 7:51 am

Postby Draygera2 » Sun Mar 30, 2014 7:54 am (link to this post)

Urfoex, would you be willing to test out the build instructions on my github? It's a modified version of the Wiki page from vayerx's repo. I added a script that should fix any compiling problems when using CMake, but I'd like some testing done. Please and thank you.
Draygera2
 
Posts: 10
Joined: Wed Feb 05, 2014 7:51 am

Postby Urfoex » Sun Mar 30, 2014 4:23 pm (link to this post)

Done.

You should really fix CMakeLists.txt and include SDL2 and not "fix" the cache.

In Debian SDL_Sound is just for SDL 1.2, is it good and O.K. to use it with SDL2?

If one of the pkg-config things
Code: Select all
-- checking for module 'libavcodec'
--   found libavcodec, version 55.34.1
-- checking for module 'libavformat'
--   found libavformat, version 55.12.0
-- checking for module 'libavdevice'
--   found libavdevice, version 54.0.0
-- checking for module 'libavutil'
--   found libavutil, version 53.3.0
-- checking for module 'libswscale'
--   found libswscale, version 2.1.2
-- checking for module 'libpostproc'
--   found libpostproc, version 52.0.100


are REQUIRED, then they should be marked as that. I don't know if they are required, preventively I installed them all.


Code: Select all
-- Some or all of the gtk libraries were not found. (missing:  GTK2_GTK_LIBRARY GTK2_GTK_INCLUDE_DIR GTK2_GDK_INCLUDE_DIR GTK2_GDKCONFIG_INCLUDE_DIR GTK2_GDK_LIBRARY)


Make it REQUIRED so it won't start compiling and then complain about missing things.
(And why does it need GTK? SDL should handle all that…)
+-----------------------------------------------------------------\
| Debian testing 64Bit on
| * AMD Phenom x4 905e (4x2500Mhz)
| * 6GB Ram
| * AMD/ATI Radeon HD4770 (fglrx)
+-----------------------------------------------------------------/
User avatar
Urfoex
 
Posts: 50
Joined: Fri Apr 15, 2011 11:14 am

Postby Draygera2 » Mon Mar 31, 2014 7:01 pm (link to this post)

The only things I can think that GTK would be used for would be the launcher and the editor, both of which, from what I can tell don't work in the source code yet. This is definitely an issue with the main branch since I've only been fixing SDL 2 stuff so far. On that note, I'd open an issue with Vayerx. The CMakeLists.txt file is messy and even says at the beginning that it needs to be fixed up.

Thanks for your help, man. I'll post more on my findings later.

EDIT: At the moment, SDL_Sound like that is ok since most of SDL2 is meant to be backwards compatible with SDL1.2, although, I do plan on rewriting it to use the SDL2 SDL_Mixer; it personally really bothers me that it's there like that, also.

On the GTK thing, I was thinking about this at work: why don't I just download the original source code before everybody started messing with it and rewrite the editor in Java using the Swing API? That would remove several dependencies on GTK and since that's my main language, it wouldn't be too difficult to do.
Draygera2
 
Posts: 10
Joined: Wed Feb 05, 2014 7:51 am

Postby Draygera2 » Tue Apr 08, 2014 8:40 am (link to this post)

It's official, most of my ideas about what I want to do with Shadowgrounds are definitely not going to benefit anyone.

I'm currently working on fixing the Keyboard problems and am making slow but steady progress. I figured out that the GameController implementation needs some reworking because the addReadKey method was crashing the game. I think it has something to do with how SDL2 handles its Keycodes. Still experimenting a bit with it.
Draygera2
 
Posts: 10
Joined: Wed Feb 05, 2014 7:51 am


Return to Technical support for Linux & Mac

Who is online

Users browsing this forum: No registered users and 3 guests

cron