Page 6 of 17

Re: (NEW RELEASE) NUMERIC HUDv1.oxp(Finally!)

Posted: Thu Jun 16, 2011 9:51 pm
by JensAyton
There seem to be two possible causes of this:
  • A logic error when setting up new GC roots and tearing down old ones in GrowCallbackList() (in OOJSFrameCallbacks.m, natch).
  • A problem with GC roots made in one JS context/compartment pair being kept around when a new context/compartment are set up on game reset.
The logic in GrowCallbackList() seems right, so I suspect our answer is behind door B. Please try changing OOJSFrameCallbacksRemoveAll() as follows:

Code: Select all

void OOJSFrameCallbacksRemoveAll(void)
{
    NSCAssert1(!sRunning, @"%s cannot be called while frame callbacks are running.", __PRETTY_FUNCTION__);
    
    JSContext *context = OOJSAcquireContext();
    
    if (sCount != 0)
    {
        while (sCount != 0)  RemoveCallbackAtIndex(context, sCount - 1);
    }
    
    // Remove all GC roots.
    OOUInteger i;
    for (i = 0; i < sHighWaterMark; i++)
    {
        JS_RemoveValueRoot(context, &sCallbacks[i].callback);
    }
    sHighWaterMark = 0;
    
    OOJSRelinquishContext(context);
}

Re: (NEW RELEASE) NUMERIC HUDv1.oxp(Finally!)

Posted: Fri Jun 17, 2011 9:41 am
by Svengali
Done, compiled with debug=no - but no luck here, Ahruman. Still getting CTDs with the procedure a_c has posted, seems to be less frequent, but is maybe just a coincidence.

In all cases it needs at least one other OXP installed to happen (or a lot more attempts, who knows).

Re: (NEW RELEASE) NUMERIC HUDv1.oxp(Finally!)

Posted: Sat Jun 18, 2011 7:22 pm
by JensAyton
In AddCallback, there’s a comment // If we haven't used this slot before, root it. At the end of that condition’s scope, add: sHighWaterMark = sCount + 1;

Also, try using console.garbageCollect() to trigger the problem.

Re: (NEW RELEASE) NUMERIC HUDv1.oxp(Finally!)

Posted: Sat Jun 18, 2011 9:19 pm
by Svengali
Looks good - R'n'R Ahruman .-)

No CTD in >50 attempts anymore and log is clean.
console.garbageCollect() doesn't trigger the CTD too.

Muchas gracias.

Re: (NEW RELEASE) NUMERIC HUDv1.oxp(Finally!)

Posted: Tue Jun 21, 2011 5:34 am
by CommonSenseOTB
Well I'm guessing that bug is fixed now. If not post here. Technically speaking then I guess the numeric hud and anything else with frame callbacks is 1.75.3 or better for compatibility.

I've been tinkering with a few things the last couple of days. Got warning backlights for critical shields and energy(<64). Crude but effective. Helps to catch your attention in combat. Almost finished the adjustable crosshair. Currently I can adjust all 4 views independantly while flying with a small target(sight)box that has 10 different positions for each view depending which view you are on. :D All that remains is to complete the basic crosshair that goes with it and then the fun begins. This will be an animated crosshair. What I'm doing is having 3 to 5 different sized sights that switch based on the range to target and will look at color change for the targets threat level possibly like the target range gauge. Other things to look at include some more gauge readouts that appear when oxp equipment is installed. If there is one that you feel is a must have then post it here. Currently thinking about railgun ammo and shield capacitor charge status.

More flight test results/comments of the numeric hud are always welcome and helpful. :D

Re: (NEW RELEASE) NUMERIC HUDv1.oxp(Finally!)

Posted: Wed Jun 22, 2011 7:27 am
by Zireael
If you drop the version with all the tweaks, I'd happily test it some more.

A few days back I flew a bit and I noticed no random slowdowns, the FPS are roughly the same as without the numeric HUD.

Re: (NEW RELEASE) NUMERIC HUDv1.oxp(Finally!)

Posted: Mon Jun 27, 2011 3:05 am
by CommonSenseOTB
Hang in there Zireael, won't be much longer.

The real tough part about doing this animated adjustable crosshair is that for every position of the sight in every view you need a duplicate adjusted for that position. Result: sore fingers. :lol:

What I've got so far is the framework and scripting for all 4 views, a crosshair with 10 different looks depending on range to target and the hud.plist coded for the front and aft views. Just the port/starboard hud.plist coding to do(need only 1 duplicated for both) and it is done.

Had some time today to test a little and I must say that being able to adjust the sight position down helps tremendously for targetting. Looks like on both forward and aft views, adjustable crosshair position 6 keeps the laser pretty much centered in the sight/target box all the way from 1 km to 25 km for a stock cobra mkIII. :D

For now I've given up on color change for the sight for 2 reasons. Color cycling/flashing may be too distracting when you are just trying to see the target at long range and it is at least double the work to add a second color and being this is only a test version/hud concept it would be better to get some real testing feedback before adding any more features. Therefore it comes in green and the further away the target is, the dimmer the sight is to improve seeing the target. :D

Version 1.2 is almost here. 8)

Re: (NEW RELEASE) NUMERIC HUDv1.oxp(Finally!)

Posted: Fri Jul 01, 2011 4:21 am
by CommonSenseOTB
Happy Canada Day!! :D

I bring you fireworks! 8)

Image
NumericHudv1.2#1 by CommonSenseOTB, on Flickr
Image
NumericHudv1.2#2 by CommonSenseOTB, on Flickr
Image
NumericHudv1.2#3 by CommonSenseOTB, on Flickr
Image
NumericHudv1.2#4 by CommonSenseOTB, on Flickr


Now available for download: NUMERIC HUDv1.2.oxp

New features: animated adjustable crosshair and shield/energy warning lights.

For the past 2 weeks I've been tinkering away to get this to work and I have found a practical limit to how much can be put in a hud.plist with "equipment_required" before the fps slowdown becomes noticeable(on my slow machine that is). The animated adjustable crosshair is a result of reworking my hud.plist additions down as low as I can and still get most of what I wanted. The only other way out would have been to have a separate hud for each crosshair position and I don't want to do it that way because it will prevent some future expansions that would need to go that route. As a result there is a little bit of slowdown from the crosshair. If it is a concern just use the old version 1.1 instead.

Have fun with this and let me know what you think. I believe a crosshair position of 5 or 6 forward and aft works pretty good on a stock Cobra MkIII. Your personal ship will be trial and error.

Download here:

http://wiki.alioth.net/index.php/Numeric_Style_HUDs

Now time for a long weekend break. See yah! :D

Re: (NEW RELEASE) NUMERIC HUDv1.2.oxp

Posted: Fri Jul 01, 2011 6:38 am
by Gimi
I will give this a test with one of my test commanders. It's fun when OXP makers push the limits of Oolite. :D

On another note. Would you mind editing your first post in the thread with the information about the latest release. (Copy and paste your last post).
It's sort of an unwritten rule that the first post contains information about and link to the latest release. It ensures that the information resides in a known place as this thread progresses.

Waiting in anticipation for your next stunt. 8)

Re: (NEW RELEASE) NUMERIC HUDv1.2.oxp

Posted: Fri Jul 01, 2011 7:48 am
by another_commander
Advice to all uploading files: For the love of everything that is holy, please do not use MediaFire as download site. There are much, much better alternatives (e.g. box.net). No need to suffer through pop-ups, ads and possible drive-by downloads just to get to a file that interests us.

Re: (NEW RELEASE) NUMERIC HUDv1.2.oxp

Posted: Fri Jul 01, 2011 8:04 am
by Smivs
That's different, and very nice indeed! Well done CSOTB. :D

Re: (NEW RELEASE) NUMERIC HUDv1.2.oxp

Posted: Fri Jul 01, 2011 9:28 am
by Zireael
I've flown around a bit and - I absolutely love it! My dream HUD. Has everything. Everything I need. I don't have to search anymore. I'm completed...

Re: (NEW RELEASE) NUMERIC HUDv1.2.oxp

Posted: Fri Jul 01, 2011 10:54 pm
by CommonSenseOTB
It would appear that I and everyone else that did playtesting missed a minor problem from version 1.1. I was trying out the new chopped cobra and realized that when buying a ship it removes the equipment controlling the crosshair adjustment. So I fixed that and then realized there was a general problem when buying a ship since 1.1. When you buy a new ship and then exit the station many of the guages were missing because the equipment controlling them was removed. Because the guages were full they weren't refreshed/redrawn. This was a minor bug that is instantly fixed when you restart the game. Surprised nobody caught it.

It's now fixed and available as NUMERIC HUDv1.2.1.oxp.

Download from my previous post just above.

Re: (NEW RELEASE) NUMERIC HUDv1.2.1.oxp

Posted: Fri Jul 01, 2011 11:14 pm
by DaddyHoggy
May be nobody bought a new ship while play testing...?

Re: (NEW RELEASE) NUMERIC HUDv1.2.1.oxp

Posted: Sat Jul 02, 2011 6:23 pm
by CommonSenseOTB
DaddyHoggy wrote:
May be nobody bought a new ship while play testing...?
Yeah, as I said it's a minor bug that fixes itself when restarting.

It's now fixed and available as NUMERIC HUDv1.2.1.oxp.

http://wiki.alioth.net/index.php/Numeric_Style_HUDs


If you find any other bugs or just have a comment your posts are always welcome here. :)