ToME: the Tales of Maj'Eyal

Everything about ToME
It is currently Tue Aug 21, 2018 12:18 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Tue Nov 29, 2016 10:17 am 
Offline
Yeek

Joined: Sun Nov 27, 2016 11:41 am
Posts: 13
Hi,

I made some work to build t-engine on OpenBSD, the compilation works now but when I execute the binary, I get a blank window, nothing happen except that the binary use 100% of a cpu.

Code:
/usr/ports/pobj/t-engine4-src-1.4.9/t-engine4-src-1.4.9% ./t-engine
WebCore config: library(/libte4-web.so) spawn(/cef3spawn)
Loading WebCore: Failed loading /libte4-web.so: File not found
[CPU] Detected 4 CPUs
OpenAL device available: OpenAL Soft (default OpenAL Soft)
Available video driver: x11
Available video driver: dummy
NO SELFEXE: bootstrapping from CWD
Creating save thread
===top 2
Booting T-Engine from: /proc
SelfExe gave us app directory of:   /
Creating particles thread 0
Creating particles thread 1
Creating particles thread 2
[DO RESIZE] Requested: 800x600 (0, 0); zoom 100%
[DO RESIZE] Got: 800x600 (0, 0)
OpenGL max texture size: 8192
OpenGL max texture size: 8192
Upgrading black texture to size 64
Running lua loader code...
[ACTION => closing the window manually]
Cleaning up!
Terminating!
Webcore shutdown complete
SDL shutdown complete
OpenAL shutdown complete
Thanks for having fun!


I only had to patch one file for the code because OpenBSD doesn't have sysctlbyname, which is harmless
Code:
--- src/getself.c.orig   Mon Nov 28 12:08:24 2016
+++ src/getself.c   Mon Nov 28 12:10:00 2016
@@ -57,8 +57,14 @@ int get_number_cpus()
 {
    int count;
    size_t size=sizeof(count);
+   int name[2];
+   name[0] = CTL_HW;
+   name[1] = HW_NCPU;
    
-   if (sysctlbyname("hw.ncpu",&count,&size,NULL,0)) return 1;
+   if (sysctl(name, 2, &count, &size, NULL, 0) < 0 {
+     count = 1;
+   }
+
    return count;
 }


I have tried to compile the game with the default lua instead of luajit but I still get the same behaviour. My computer is able to run games like minecraft so the graphics capability should be ok to start the game.

Am I doing something wrong ? Do I need to do something else to start the game ?

When I use the OpenBSD ktrace tool to look at system calls, I see this a LOT (ktrace is producing 23 Mb of text running the game for ONE second), this would explain the cpu usage and why it's hanging, but I'm not sure about why it's doing this.
Code:
[..this is only a very little portion of the traces, this part is getting repeated indefinitely..]
 20859 t-engine CALL  select(5,0x7f7ffffd7550,0,0,0x9f1dbfb73a0)
 20859 t-engine STRU  struct timeval { 0 }
 20859 t-engine STRU  struct fd_set { 4 }
 20859 t-engine STRU  struct fd_set { }
 20859 t-engine RET   select 0
 20859 t-engine CALL  clock_gettime(CLOCK_MONOTONIC,0x7f7ffffd7760)
 20859 t-engine STRU  struct timespec { 522529.616377936 }
 20859 t-engine RET   clock_gettime 0
 20859 t-engine CALL  recvmsg(4,0x7f7ffffd6dd0,0)
 20859 t-engine RET   recvmsg -1 errno 35 Resource temporarily unavailable
 20859 t-engine CALL  select(5,0x7f7ffffd7550,0,0,0x9f1dbfb73a0)
 20859 t-engine STRU  struct timeval { 0 }
 20859 t-engine STRU  struct fd_set { 4 }
 20859 t-engine STRU  struct fd_set { }
 20859 t-engine RET   select 0
 20859 t-engine CALL  clock_gettime(CLOCK_MONOTONIC,0x7f7ffffd7760)


Top
 Profile  
 
PostPosted: Tue Nov 29, 2016 11:21 am 
Offline
Master of Eyal

Joined: Wed Jul 24, 2002 9:26 pm
Posts: 10228
Location: Angolwen
Those lines are the culprits:
Code:
Booting T-Engine from: /proc


This is the selfexe path being wrong, look at the bsd code in getself.c it must be broken, it should return the path to the executable

_________________
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning ;)


Top
 Profile  
 
PostPosted: Tue Nov 29, 2016 11:36 am 
Offline
Yeek

Joined: Sun Nov 27, 2016 11:41 am
Posts: 13
darkgod wrote:
Those lines are the culprits:
Code:
Booting T-Engine from: /proc


This is the selfexe path being wrong, look at the bsd code in getself.c it must be broken, it should return the path to the executable


indeed, it seems FreeBSD has some patches for this. I'll look how to fix this :)


Top
 Profile  
 
PostPosted: Tue Nov 29, 2016 12:04 pm 
Offline
Yeek

Joined: Sun Nov 27, 2016 11:41 am
Posts: 13
rapenne-s wrote:
darkgod wrote:
Those lines are the culprits:
Code:
Booting T-Engine from: /proc


This is the selfexe path being wrong, look at the bsd code in getself.c it must be broken, it should return the path to the executable


indeed, it seems FreeBSD has some patches for this. I'll look how to fix this :)


OpenBSD doesn't have a way to find the path of a running executable. As it's bundled from ports, I will hard code the path, this won't be a problem.

I have more success running the game on OpenBSD than on Windows :mrgreen: :mrgreen:


Top
 Profile  
 
PostPosted: Thu Dec 29, 2016 4:10 pm 
Offline
Yeek

Joined: Sun Nov 27, 2016 11:41 am
Posts: 13
I am happy to announce that now ToME is available in OpenBSD packages
http://cvsweb.openbsd.org/cgi-bin/cvswe ... mes/tome4/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group