# PureBasic Forum

 It is currently Thu Apr 25, 2019 11:18 pm

 All times are UTC + 1 hour

 Page 3 of 3 [ 34 posts ] Go to page Previous  1, 2, 3
 Print view Previous topic | Next topic
Author Message
 Post subject: Re: [Game] ScavengerPosted: Mon Oct 15, 2018 10:32 pm
 User

Joined: Fri Jun 17, 2016 12:06 am
Posts: 21
Only just seen this thread and HOLY COW! Great work!

_________________
Arkanix Labs | Cosine Systems | Compilation64

Top

 Post subject: Re: [Game] ScavengerPosted: Mon Oct 22, 2018 5:54 am
 New User

Joined: Sun May 05, 2013 7:56 am
Posts: 9
Joubarbe wrote:
Indeed it looks like the biggest game ever created with PB. Impressive!

Thanks!

Joubarbe wrote:
Would be very cool to know a bit more about the technical. I suppose you created all your libraries? (that is, apart from the ones PB provides obviously)

Regarding libraries, there's not a lot. I did write a couple library functions. I did an implementation of Wu antialiased lines and circles, and a lookup table based polar to rectangular coordinate conversion.

One library function I wrote that I use a lot seems simple, but matches the way I think about things. It's a simple ranging interpolation thing. If you call range(x,xmin,xmax,outmin,outmax) it returns the value that is analogous. If x<=xmin, it returns outmin. If x>=xmax, it returns outmax. If x is 33% from xmin to xmax, it returns the value 33% from outmin to outmax. It seems simple, but it's extremely useful to me.

xposition=range(currenttime,animationstarttime,animationendtime,startposition,endposition) - that's linear robot motion described in a simple easy to understand wrapper. Sure, you can describe the same thing other ways, but that five argument form is really easy to tweak later.

Hmm... what else... I rolled my own 3D sound subsystem, because the built in PB one doesn't do stereo panning, only linear volume attenuation. I wanted stereo panning and doppler shifting. You can create that functionality building from the normal sound functions, though.

Joubarbe wrote:
How did you organize your code for such a project?

Minimally.

The config tool is one file, the library functions are in one file, the module screen displays are in one file, the gameworld generator executable is in one file, and the entire rest of the game is in one file.

I pull stuff out into functions when it feels appropriate to me to, but I'm not a stickler about it. I was out to build a game, not a carefully refactored gem of pristine source code.

Joubarbe wrote:
What was the most frustrating things you encountered (about PB and how it could be improved)?

There are some interesting "gotchas" that I ran into. I wrote this in 5.22LTS, so some of these may already be fixed.

If I turn on shadow casting, and then create a mesh, mesh creation silently fails. You get an invisible mesh with a line segment for a bounding box. I can only create meshes BEFORE I enable stencil shadows - all subsequent mesh creation will fail from that point. That is why my gameworld generator is it's own separate executable, because it never enables shadows, it can always generate meshes successfully.

If I create a camera with a visibility group mask, the mask doesn't work. If I instantly recreate that exact same camera with the same mask, then it works.

You can oversaturate the mouse event queue pretty easily if you have a high DPI gaming mouse. Try it - write a program to detect whether a mouse button is down, and then hold down the button and scribble the mouse around rapidly. You'll start seeing the mousebutton showing phantom releases because the internal queue overfilled. I had to spin mouse handling off into it's own thread that does nothing else and then sets me some global semaphore variables the main game thread can read at leisure - otherwise mousedrags start breaking.

There are some weirdnesses with trying to extract euler angles back out of Ogre3D, because it's internally using quats. Don't expect the get-yaw/get-pitch/get-roll functions to do what you want, or even necessarily anything meaningful to a human.

Sometimes, it crashes on exit on win7. It never does that in winXP. I never did figure out why.

It may sound like I'm complaining a lot here - I don't mean to be. I would never have written the game at all without Purebasic. PB is awesome.

For everything I ran into that was janky or broken, I was able to work around it within PB. There's no shims written in C or anything. The shaders are in .cg of course, but other than that, the game's all purebasic.

Joubarbe wrote:
Did you finally manage to fully solve the false positive problem?

No. It vexes me very much.

After fighting it a lot, and having random new false positives keep appearing, I gave up trying to fix it on my side, and submitted the final build of the game executables to a lot of AV vendors. Some of them whitelisted it. Some never did.

That pretty much keeps me from ever patching the game from here. I'd have to resubmit the new exes to dozens of vendors and hope they whitelist again.

Top

 Post subject: Re: [Game] ScavengerPosted: Mon Oct 22, 2018 7:44 am
 Enthusiast

Joined: Wed Sep 18, 2013 11:54 am
Posts: 321
Location: France

I've experienced this mouse problem you mentioned, as well as this false positive huge problem. I really hope the PB team will look at your post, very interesting things in there.

Quote:
I was out to build a game, not a carefully refactored gem of pristine source code.

So true. This craziness we know nowadays that consist of releasing a new framework of a framework every month is getting nowhere. People should learn how to code old-school. That being said, I'm doing an extensive usage of modules in my projects (with tons of files).

Ogre current version is not integrated into PB. Maybe that would have fixed your other 3D problems

About the false positives: is there any difference between 32b and 64b releases?

Top

 Post subject: Re: [Game] ScavengerPosted: Thu Nov 15, 2018 4:01 am
 New User

Joined: Sun May 05, 2013 7:56 am
Posts: 9
Joubarbe wrote:

About the false positives: is there any difference between 32b and 64b releases?

Not that I have noticed, no.

(I am sure Fred's as annoyed by the industry-wide AV situation as I am - I want to make clear that I don't blame him a bit, this isn't in my opinion his fault at all.)

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 3 of 3 [ 34 posts ] Go to page Previous  1, 2, 3

 All times are UTC + 1 hour

#### Who is online

Users browsing this forum: No registered users and 4 guests

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

Search for:
 Jump to:  Select a forum ------------------ PureBasic    Coding Questions    Game Programming    3D Programming    Assembly Programming    The PureBasic Editor    The PureBasic Form Designer    General Discussion    Feature Requests and Wishlists    Tricks 'n' Tips Bug Reports    Bugs - Windows    Bugs - Linux    Bugs - Mac OSX    Bugs - Documentation OS Specific    AmigaOS    Linux    Windows    Mac OSX Miscellaneous    Announcement    Off Topic Showcase    Applications - Feedback and Discussion    PureFORM & JaPBe    TailBite