Flakes Construction Yard

Personal work in progress topics go here
User avatar
Midnight Rambler
Staff
Staff
Posts: 2136
Joined: Thu Feb 10, 2011 11:08 pm
Favorite Aircraft: F-16
Location: Australia
OS: Windows 11
Has thanked: 267 times
Been thanked: 374 times

Re: Flakes Construction Yard

Post by Midnight Rambler »

What is that 1-10 rating relative to? Is that related to relative aircraft performance (dat A compared to dat B, to dat C etc...) and the 1-10 is a floating and moveable adjustment? Or are you setting the ratings from 1-10 and aircraft slot into your ratings based on their numbers? Oooor is it some other wizarding mastery?

I can't really help, just curious :)
Image
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: Flakes Construction Yard

Post by Flake »

All aircraft will be able to be given a score from 0 to 10 in 6 categories: ThrustToWeight, TurnRate, Strength, WeaponsLoadout, Stealth, Speed.

Sort of like how a spider graph works in most arcade games.
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
User avatar
Zack
Contributor
Contributor
Posts: 401
Joined: Wed Mar 21, 2012 10:34 pm
Favorite Aircraft: F-16C Fighting Falcon
Location: Northern California/Bay Area
OS: Windows 10
Has thanked: 47 times
Been thanked: 158 times

Re: Flakes Construction Yard

Post by Zack »

is the UI Going to be just slider bars or an actual spider graph?
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: Flakes Construction Yard

Post by Flake »

It'll just be a TXT file report to begin with, but eventually a graphical output would be the goal.

-----

Finished the quadratic equation, working sweet so far! The function should give me 0 when thrust to weight ratio is 0.0, 5 when the T:W is 0.5, and 10 if the T:W is 2.0m which it does do.

Image

Code: Select all

public static Quadratic From3Points(decimal x1, decimal x2, decimal x3, decimal y1, decimal y2, decimal y3)
{
    //Convert the 3 points to quadratic equations.
    Quadratic equation1 = new Quadratic(x1, y1);
    Quadratic equation2 = new Quadratic(x2, y2);
    Quadratic equation3 = new Quadratic(x3, y3);

    //Cancel out "C"
    Quadratic equation4 = equation1.MakeSubject(equation1.C) - equation2.MakeSubject(equation2.C);
    Quadratic equation5 = equation2.MakeSubject(equation2.C) - equation3.MakeSubject(equation3.C);

    //Cancel out "B"
    Quadratic equation6 = equation4.MakeSubject(equation4.B) - equation5.MakeSubject(equation5.B);

    //Solve for A then B then C
    var a = equation6.MakeSubject(equation6.A).Result;
    var b = (equation4.Result - equation4.A*a)/equation4.B;
    var c = y1 - (a * x1 * x1) - (b * x1);

    //Create new Quadratic solver based on A B and C.
    var output = new Quadratic
    {
        A = a,
        B = b,
        C = c
    };
    return output;
}
Hopefully I can finish this off tonight and release a simple DAT checker program to run an analysis on a droped DAT file. ;)
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: Flakes Construction Yard

Post by Flake »

HERE'S THE MOTHERLODE FOLKS.

A complete raw data dump from my program that tests EVERY installed DAT and shows it's spider graph performances. You can use this raw dump from my install to verify a particular DAT's scores.

At the top of the dump are a few "files missing" warnings - This is not an error. These addons have errors that the pack creators may want to look at. It throws an error if the DAT, DNM or Collision files are missing. In these cases, definitions exist, but the files do not.

Anyways, have fun. Huge dump below.

http://pastebin.com/raw/pLnjCDNf
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: Flakes Construction Yard

Post by Flake »

Another, more readable test.
SpiderTest_201612162126.zip
(54.45 KiB) Downloaded 502 times
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
User avatar
Zack
Contributor
Contributor
Posts: 401
Joined: Wed Mar 21, 2012 10:34 pm
Favorite Aircraft: F-16C Fighting Falcon
Location: Northern California/Bay Area
OS: Windows 10
Has thanked: 47 times
Been thanked: 158 times

Re: Flakes Construction Yard

Post by Zack »

aw yiss
NightRaven
Senior Veteran
Senior Veteran
Posts: 1851
Joined: Tue Feb 07, 2012 10:00 am
Favorite Aircraft: .
OS: windoze 10 64-bit
Has thanked: 617 times
Been thanked: 619 times

Re: Flakes Construction Yard

Post by NightRaven »

Flake, just curious, is this entire copy pasting and calculating based off the dat variables? I am unsure if this will be entirely accurate given the (probable) different flying styles (flaps, rudder etc). Does it also take into account TVC?

also, it seems the summary of the tested lst is broken. The min, max, standard deviation etc all seem the have the same value (at least for the second dump).
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: Flakes Construction Yard

Post by Flake »

I don't think I tied statistics back in, will need to do that.

Flaps/TVC etc is hard to calculate stats for. More variables, more ambiguity.

Completely open to suggestions though if you have equations in mind.
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: Flakes Construction Yard

Post by Flake »

Regarding Flakes Library I'm considering ongoing compatibility.

I'm coding for .NET 4.0 now as part of this library. I'm not necessarily targetting windows as a principle now. Any platform that supports .Net 4.0, It should be possible to build Flakes Library for. This means OYS and etc. could eventually come to Mac/Linux through Mono and etc. Another cool potential is ASP.NET, allowing OYS to be run on a dedicated web server(?). It's something to look into later when I get there. Point is, I won't be building any platform specific work arounds into the library, instead I'll build the library to not rely on specific environments.

This means that Direct3D will not be used by my Library. It also means Windows Console etc. will not be expressly called. I'll still use the console, but Terminal->MacOSX/Linux will work exactly the same.

There is a big consequence of this: I need to build my own window presentation library. Kind of like how Soji has moved away from using windows libraries for presentation of the user interface, I too will try and build my own presentation library as part of Flakes Library. I do have experience doing this in Game Maker, so it's nothing new to me. It's just a LOT of work.

It's the next logical step in code development. I need to start makign the library usable for end users just like you. To do this, it'll need a UI. And I'm not wasting my time developing a UI I'll just have to re-write later.

By the way - regarding ".NET/C# == Windows Only", that is changing. Microsoft are upping their game and .NET is being extended to many platforms. If you at home wish to learn and language, I highly advise Java, believe it or not, as it is the most compatible with all platforms, very expressive and similar to C# too. I'll stick with C# for now as I beleive in it's potential. LINQ to objects is something I absolutely need to use given the nature of the expressive software I'm writing, hence why I'm staying away from c++ and other "low" level languages.

So short term road map:
Develop clean Message/String library -> A string encompasser that can be more expressive: MessageType, Bold/Italic/Underline/Color (Mincraft style color codes)

Proper output/input handling using events and delegates -> can just plug and play input and output modules for more rapid application development. This will extend the String Library above, hence this comes after. Some input/output loggers will only handle certain message types for example, or present them in different ways...

DeviceInterface Library -> Will have to do everything from scratch: Render a window using OpenGL, get keyboard input, get mouse input, play sound using


Then extend the- blah blah blah blah blah. I went and did some more coding, 1) to clean up a bit and 2) to understand my own code a little better and make it easier to read. I've predominantly been changing variable scope (accessibility) to limit my options in intellisense, and make the method names and functions more intuitive. I also removed some doubled up code regarding preparing strings from CommandFiles (Space delimited funtion files such as LST, DAT, ACP...)

I've realised that there are many forks I can take right now to develop the library to our next stage. Problem is, some may end up depending on each other. I need to work out which ones are the fastest to build, and the simplest to build, and the most referenced (very deep in the reference hierachy.) I'm just going to keep cleaning and thinking about this.
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
User avatar
u2fly
Senior Veteran
Senior Veteran
Posts: 1485
Joined: Fri Oct 02, 2015 9:27 am
Favorite Aircraft: Antonov An-225 Mriya
Location: Ukraine
OS: Linux
Has thanked: 1051 times
Been thanked: 339 times

Re: Flakes Construction Yard

Post by u2fly »

For cross compatibilyte between Linux, Windows and MacOS the best way for creating some tools is use Python (3.x or 2.7x). It's my opinion.

U.S. Senator John McCain wrote:“Spending #NewYearsEve w/ brave #Ukrainian Marines at a forward combat outpost
- we stand w/ them in their fight against #Putin's aggression”

pic.twitter.com/vkz0gdozVV [archived]
(31 DEC 2016)
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: Flakes Construction Yard

Post by Flake »

Finally got hardpoints and weapons loading to play nice. I'm loading the weapons available to the aircraft right now (Max AAM it can have loaded etc.)

The hard part is finding a fair score to assign to each weapon type. I mean, one rocket should not be worth as much as one AAM in the score calculation.

I need some help with this. The score assigned to:

1 AIM-9 == 1.0
1 AIM-9X == 0.8
...
continue for each weapon type. What should the weighting be for each?
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
User avatar
u2fly
Senior Veteran
Senior Veteran
Posts: 1485
Joined: Fri Oct 02, 2015 9:27 am
Favorite Aircraft: Antonov An-225 Mriya
Location: Ukraine
OS: Linux
Has thanked: 1051 times
Been thanked: 339 times

Re: Flakes Construction Yard

Post by u2fly »

xX_SuperSic58_Xx wrote:What should the weighting be for each?
Try read chapter about DAT files in my "YSFLIGHT HANDBOOK" (link in my sign)
And also give a look on "Weapon Weights" research by @decaff_42
http://www.mediafire.com/file/2t4c4oyra ... eights.pdf

U.S. Senator John McCain wrote:“Spending #NewYearsEve w/ brave #Ukrainian Marines at a forward combat outpost
- we stand w/ them in their fight against #Putin's aggression”

pic.twitter.com/vkz0gdozVV [archived]
(31 DEC 2016)
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: Flakes Construction Yard

Post by Flake »

Better move back into my garage with my updates.

Sorted the formatting issue. I forgot to set a variable, and I duplicated a method.

I've also created a thread for updating textboxes all pretty like, and then limited the processing to only what is visible on screen.

I might have to clear old messages from the window though, as they add to memory usage pretty quickly. 1000 messages maximum ought to do it.

Image

----

Fixed up most of the UI, now Stress testing. I've made a thread that will add one message per second, I'm watching the memory count and processor %, all looks swell. Currently counting the number of messages being added to the list.

Image
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: Flakes Construction Yard

Post by Flake »

Okie doke I had a good think about this one and the lag is ridiculous over 250 messages.

Each message component (Date, Time, Username, Message) is it's own RichTextBox currently.

So 250 messages * 4 = 1000 rich text boxes, all stacked into a table layout panel which is laggy in it's own right.

That' never going to work, and explains why MY pc caught fire at 750+ messages.

So I thought "Oh greaaaat. Now I have to learn OpenGL..." and actually...

There's a better way.

ONE RichTextBox, where everytime I add a new message, or turn datetime off etc, it re-populates the text box, but adding the strings together and formatting. It means you might get 1s delay or less if turning date column on or off, but adding a new message will be super fast and you could have like 10 000+ messages in there and it shouldn't lag up.

Less controls is more performance.

I'll try that over the next few days.

----

Or I can get the entire job completely done in one afternoon...

Image

CPU Usage 0% when stationary, 13% when I was testing at ~400 messages per second (uncapped).
RAM Usage 19.5mb with 5000 messages in the stack.

All the checkboxes and everything is working perfectly. This is the urn, folks!

Minor Edit: For usability, limited the redraw to last 100 messages only if changing a checkbox. Redrawing all the messages takes forever. 100, only like a second at best.

----

Time to burn my computer to the ground I guess. This test should be definitive.

Image

EDIT: We got to around 27,000 messages before it started to freeze up. Still that's way more than I ever intend to put in there (like 1000 at a time max.) The lag at that point was propbably because the list of objects was too large, more so than the text box. (Editing a list of 27,000 objects is sure to lag...)

So today, I'll start cleaning things up and organising my workspace and my head, so that I can start building a basic user database. All I want to do is track users by YSFHQ ID for now. I sure hope that API is still up hahahaha. Nothing else will be added. No flight tracking, no nothing. Build small, make sure it works, add funtionality later. I should be able to achieve that either today or tomorrow. Today: Clean up, Tomorrow: UserDB.
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: Flakes Construction Yard

Post by Flake »

I wrote a thing for decaff, would be a shame to lose this information:
  1. Packets 48,49 and 50 are Fog, Sky and Ground color packets respectively.

    Data is: byte Red, byte Green, byte Blue.

    Compatible with YSFlight Version 2015 and newer. It's how I did the horizon color and sky colors for OYS and day/night changes. I never used the ground color packet.

     
  2. You are being logged out because you are not sending Packet Type 17 "Heartbeat", which is data-less. Even if you send data of other packet types all the time, you need to send this at least every 60 seconds to keep the connection alive, if you are a client, otherwise the server falsely believes you are doing nothing. Brilliant net-code flaw...

     
  3. The server will send a Packet Type 11 "Flight Data" whenever there is an update to a YSFlight Vehicle that is an Aircraft object. It will send Packet Type 21 "Ground Data" for a ground object. The updates can come from another client (the client sends type 11/21 to server, the server then updates its records and sends type 11/21 to everyone else), or the update can be generated by the server itself, for example, when running endurance combat mode and the server creates it's own aircraft, or a ground object on the server is assigned to a motion path.

     
  4. You can request the list of users by sending a dataless Packet Type 37 "Userlist". Server will reply with same type 37 repeatedly, for each client.

    Data is: Int16 ClientType (0,1,2 or 3. I can't remember which is which but it goes something like: client not flying, client flying, server not flying, server flying.), Int16 IFF, Int32 VehicleID, string Username (max 16 chars).
----

Console UI is DONE.

Image

Cleaned up the code, added some thread safe functionality by adding a ConcurrentQueue seperate from the UI for adding messages to, and cleaned up the accessability of the code (private/publics/internals). There is now only one public method for the console class: "AddMessage". So now I can just add a RichTextMessage to the control from anywhere in the code, with no funky workarounds in other threads, and it'll just work, and I've now sealed the class so I can't do anything stupid in the future to the console UI cross-thread. Safe coding!

UserDB planning time.

----

By the way, this is what my project dependency tree looks like for now. Makes sense, right?

Image

----

Went through and cleaned up some code, adding summarys and notations to classes and methods so I know how to user them properly, and packing into regions to make easier to read. Some method names were very shit so I renamed a few. I also learned how to use the "Task View" in visual studio, plus tokens, so I can declare HACKy work arounds and TODO's, so I'll use that more. I'm bored as hell of cleaning up but I've only got the YSFlight Files class to go now. Everything else is really clean and easy to use already so not much to change. Time to do some mental coding and think about how I'm going to set up the UserDB...
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: Flakes Construction Yard

Post by Flake »

Image

Image

Success so far with a basic login check with YSFHQ. Good to see my API Key hasn't changed!

Exhausted. Time for bed. I might try and work less tomorrow, need some time off!
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: Flakes Construction Yard

Post by Flake »

Image

Got the UserDB sorted out. I had a minor project dependency issue. I've seperated RichTextMessage into two projects: RichTextString and RichTextMessage. RichTextString is a base class that adds color formatting to a system string, and RichTextMessage combines various parts of the program tree with RichTextStrings. Console references UserDB to add user objects direct by the object reference, and not by a string.

Image

Pressing on...
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: Flakes Construction Yard

Post by Flake »

Image

Now able to add multi-line messages without screwing up the console formatting.

Can now right click on a message in the console and the code will find the relevent message in the back end queue for operating on. This will be used to drive the right click context menu for each user as their messages come into the console, which I will link up tomorrow.
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
User avatar
Flake
VFA-49
VFA-49
Posts: 4375
Joined: Thu Feb 10, 2011 8:47 pm
Favorite Aircraft: Boeing F/A-18A
Location: Australia
OS: Windows 10 (x64)
Has thanked: 861 times
Been thanked: 1279 times
Contact:

Re: Flakes Construction Yard

Post by Flake »

Image

Put in heaps of work today creating Groups, Ranks and Permissions systems, and it appears to be effective. I've just got to refactor now to change the command structure from being:

Code: Select all

User.Can(UsersRank.Permission, Users.Console);
to

Code: Select all

User.Can.Permission(User, [GroupScope]);
Eg:

Code: Select all

User.Can.Ban(Otheruser);
User.Can.Promote(Otheruser, Groups.Server);
Which won't take long at all.

After that, I'll link the UI and Database together, then I'll finally be able to build the server side of the application.
I am an accountant working full-time (and some). I'm not here as often as I would like to be. Send a message if you need me. There are a few people in the community who can get in contact with me urgently if you need - don't be afraid to ask. I just don't check here as frequently as I used to. Sorry!
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests