Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: SFML DOOM  (Read 23303 times)

0 Members and 1 Guest are viewing this topic.

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: SFML DOOM
« Reply #15 on: May 09, 2016, 01:11:48 am »
A 16 bit sample ranges from 0 to 65,025, so you've got 65,026 steps.
Isn't this 65,536 steps? i.e. [-32768, 32767]
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: SFML DOOM
« Reply #16 on: May 09, 2016, 05:59:14 pm »
Yeah, my bad. I should use 256 rather than 255 in the math. ;)

256 * 256 = 65,536

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: SFML DOOM
« Reply #17 on: May 10, 2016, 01:41:35 am »
It was an accident. I knew as much! ;)

It does mean that shifting left 8 times shouldn't cause any clipping though. You're effectively just shifting the 8 bits to the 8 most significant bits of the 16, which is the idea.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: SFML DOOM
« Reply #18 on: May 10, 2016, 04:33:19 pm »
Correct, but at least in my case the sound got really loud and it felt like overdriving (despite that not being the case). This might have to do with additional audio processing done by the sound card (stereo upmix), but not sure to be honest.

Jonny

  • Full Member
  • ***
  • Posts: 114
    • View Profile
    • Email
Re: SFML DOOM
« Reply #19 on: July 03, 2016, 04:17:08 pm »
A couple of updates:

  • I've Implemented controller support now, both in the game and menus (usual fps controls)
  • Fixed distortion on sounds. After much internet reading it turns out the sign needs to be flipped as well because 8bit sounds are unsigned whereas 16bit are signed. So now bitshifting by 8 and flipping the sign bit makes is sound near as damn it perfect!

CleverBoy

  • Newbie
  • *
  • Posts: 25
  • Game on!!
    • View Profile
    • Email
Re: SFML DOOM
« Reply #20 on: August 20, 2016, 01:49:33 pm »
Hi,

I am trying to compile the code in ubuntu linux using the latest version of SFML 2.4.0 and almost the spent the entire day with no luck. Built SFML version 2.2 as well but get errors regarding undefined references. I might have missed, but can anyone please let me know which version of SFML is to be used and if compiling steps are listed that would be great..

Many Thanks.... 

Mario

  • SFML Team
  • Hero Member
  • *****
  • Posts: 879
    • View Profile
Re: SFML DOOM
« Reply #21 on: August 20, 2016, 10:47:53 pm »
Think Jonny started this with 2.3.x, but it should build with 2.4 just fine. Do you have some specific error messages?

CleverBoy

  • Newbie
  • *
  • Posts: 25
  • Game on!!
    • View Profile
    • Email
Re: SFML DOOM
« Reply #22 on: August 21, 2016, 12:09:15 pm »
This the error..

[100%] Linking CXX executable doom
/usr/local/lib/libsfml-graphics.so: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
CMakeFiles/doom.dir/build.make:1659: recipe for target 'doom' failed
make[2]: *** [doom] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/doom.dir/all' failed
make[1]: *** [CMakeFiles/doom.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

This is with the latest stable version of SFML 2.4

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
AW: SFML DOOM
« Reply #23 on: August 22, 2016, 10:35:56 am »
Try to do a full rebuild of your app and/or reinstall/rebuild SFML.
Sounds like the SFML .so is corrupted for some reason.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

CleverBoy

  • Newbie
  • *
  • Posts: 25
  • Game on!!
    • View Profile
    • Email
Re: SFML DOOM
« Reply #24 on: August 22, 2016, 02:02:45 pm »
Tried after re-installing SFML and created both static and release versions of the libraries. Also rebuilt the game. Same error. I used the BUILD_SHARED_LIBS flag to yes to build both 32 and 62 bit version. Am i doing anything wrong ?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
AW: SFML DOOM
« Reply #25 on: August 22, 2016, 09:50:28 pm »
After quickly Googling the error it seems that it might be a architecture mismatch. Like you've built Thor in 32bit but then you might try to link 64bit libraries.

Make sure that either everything is 32bit or everything is 64bit, don't mix them!
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Jonny

  • Full Member
  • ***
  • Posts: 114
    • View Profile
    • Email
Re: SFML DOOM
« Reply #26 on: August 24, 2016, 11:55:54 am »
Updated it to use 2.4 yesterday for the new cursor grab stuff, so that's the minimum required version now.

Currently it only works as 32bit because of the pointer arithmetic, which I understand is a bit of a pain on Linux, but can certainly be done. I'm not sure if BUILD_SHARED_LIBS will have any impact on whether you're building 64 or 32 bit. IIRC I had to manually modify the makefile for SFML to add the -m32 flag to get it to build 32bit.


CleverBoy

  • Newbie
  • *
  • Posts: 25
  • Game on!!
    • View Profile
    • Email
Re: SFML DOOM
« Reply #27 on: August 26, 2016, 04:20:27 pm »
Hi Jonny,

Thank you for your reply. 

Are you on windows  64 bit and SFML 32 bit libraries ?

>>Currently it only works as 32bit because of the pointer arithmetic.
Can you please let me know do i need to install Linux 32 bit version? I am not able to get the 32 bit SFML compiled due to linking errors libX11 on 64 bit linux.

>> IIRC I had to manually modify the makefile for SFML to add the -m32 flag to get it to build 32bit.
I see there is a -m32 flag in CMakeLists.txt but is still fails on Linux 64 bit version.
[ 16%] Linking CXX executable doom
/usr/local/lib/libsfml-graphics.so: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
CMakeFiles/doom.dir/build.make:1659: recipe for target 'doom' failed
make[2]: *** [doom] Error


Jonny

  • Full Member
  • ***
  • Posts: 114
    • View Profile
    • Email
Re: SFML DOOM
« Reply #28 on: August 30, 2016, 12:48:06 pm »
Yes I'm on windows, building everything 32 bit

The -m32 flag is already there for SFML-DOOM, but without 32 bit SFML binaries it won't work, so you'll have to use the same flag when compiling SFML. I think to install the 32 bit versions of SFML dependencies just add ":i386" on to the end of the package name (that worked for me using apt-get at least).

Once you've got SFML compiled as 32 bit then the cmakelists provided for SFML-DOOM should theoretically just work (although sods law I've put the wrong slash in one of the includes since I last built on Linux!)

Hope this helps

Jonny

  • Full Member
  • ***
  • Posts: 114
    • View Profile
    • Email
Re: SFML DOOM v0.1
« Reply #29 on: September 23, 2016, 09:21:24 am »
Thanks to Aster and some of the other #sfml IRC posse, linux 64 bit builds should now be working. I've also added builds for Linux and Windows to the github page, OS X will follow shortly.

Feel free to add any issues/feedback you have either in here or on the github page - I'm kind of procrastinating to avoid doing the music/network code so anything else to focus on would be great :P

 

anything