(NEW RELEASE) NumericHUDv3.oxp

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: winston, another_commander

Post Reply
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

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

Post 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);
}
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

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

Post 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).
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

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

Post 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.
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

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

Post 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.
User avatar
CommonSenseOTB
---- E L I T E ----
---- E L I T E ----
Posts: 1397
Joined: Wed May 04, 2011 10:42 am
Location: Saskatchewan, Canada

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

Post 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
Take an idea from one person and twist or modify it in a different way as a return suggestion so another person can see a part of it that can apply to the oxp they are working on.


CommonSense 'Outside-the-Box' Design Studios Ltd.
WIKI+OXPs
Zireael
---- E L I T E ----
---- E L I T E ----
Posts: 1396
Joined: Tue Nov 09, 2010 1:44 pm

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

Post 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.
User avatar
CommonSenseOTB
---- E L I T E ----
---- E L I T E ----
Posts: 1397
Joined: Wed May 04, 2011 10:42 am
Location: Saskatchewan, Canada

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

Post 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)
Take an idea from one person and twist or modify it in a different way as a return suggestion so another person can see a part of it that can apply to the oxp they are working on.


CommonSense 'Outside-the-Box' Design Studios Ltd.
WIKI+OXPs
User avatar
CommonSenseOTB
---- E L I T E ----
---- E L I T E ----
Posts: 1397
Joined: Wed May 04, 2011 10:42 am
Location: Saskatchewan, Canada

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

Post 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
Take an idea from one person and twist or modify it in a different way as a return suggestion so another person can see a part of it that can apply to the oxp they are working on.


CommonSense 'Outside-the-Box' Design Studios Ltd.
WIKI+OXPs
User avatar
Gimi
---- E L I T E ----
---- E L I T E ----
Posts: 2073
Joined: Tue Aug 29, 2006 5:02 pm
Location: Norway

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

Post 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)
"A brilliant game of blasting and trading... Truly a mega-game... The game of a lifetime."
(Gold Medal Award, Zzap!64 May 1985).
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6683
Joined: Wed Feb 28, 2007 7:54 am

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

Post 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.
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

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

Post by Smivs »

That's different, and very nice indeed! Well done CSOTB. :D
Commander Smivs, the friendliest Gourd this side of Riedquat.
Zireael
---- E L I T E ----
---- E L I T E ----
Posts: 1396
Joined: Tue Nov 09, 2010 1:44 pm

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

Post 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...
User avatar
CommonSenseOTB
---- E L I T E ----
---- E L I T E ----
Posts: 1397
Joined: Wed May 04, 2011 10:42 am
Location: Saskatchewan, Canada

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

Post 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.
Take an idea from one person and twist or modify it in a different way as a return suggestion so another person can see a part of it that can apply to the oxp they are working on.


CommonSense 'Outside-the-Box' Design Studios Ltd.
WIKI+OXPs
User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8515
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

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

Post by DaddyHoggy »

May be nobody bought a new ship while play testing...?
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
User avatar
CommonSenseOTB
---- E L I T E ----
---- E L I T E ----
Posts: 1397
Joined: Wed May 04, 2011 10:42 am
Location: Saskatchewan, Canada

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

Post 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. :)
Take an idea from one person and twist or modify it in a different way as a return suggestion so another person can see a part of it that can apply to the oxp they are working on.


CommonSense 'Outside-the-Box' Design Studios Ltd.
WIKI+OXPs
Post Reply