Author Topic: Crazybob's Points Map  (Read 27350 times)

0 Members and 1 Guest are viewing this topic.

Offline [MAF]Karlis

Re: Crazybob's Points Map
« Reply #75 on: November 05, 2012, 05:12:33 pm »
then you could try to hardcode it?

Offline [MAF]Karlis

Re: Crazybob's Points Map
« Reply #76 on: November 05, 2012, 07:03:37 pm »
here's func that i came up with for that. it is based on alpha change and it assumes that drawPixel function has merged color value, if thats not the case it needs some adjustments.
NOTE: i did test it, but not visually, so its not warranted to be bugfree.
Code: [Select]
int DrawPixelInbetween(float fx, float fy, int color)
{
int ix = (int)fx; //the base integers
int iy = (int)fy;
int offx = int(0xff*(fx - ix)); //the multipliers, think of them as floats ( makes int and float mixed math easier)
int offy = int(0xff*(fy - iy));
int alpha = (color & 0xff000000) / 0xffff; // getting alpha, divided with 0xffff because multipliers before should bring the value back to original or decrease it accordingly
color &= 0xffffff; // get normal color
DrawPixel(ix + 1,iy + 1, color | (alpha * offx * offy & 0xff000000)); //get alpha at particular point and merge it back to normal color
DrawPixel(ix, iy + 1, color | (alpha * (0xff - offx) * offy & 0xff000000));
DrawPixel(ix + 1, iy, color | (alpha * offx * (0xff - offy) & 0xff000000));
DrawPixel(ix, iy, color | (alpha * (0xff - offx) * (0xff - offy) & 0xff000000));
return 1;
}

EDIT: apparently it has 1 bit precision loss, no big deal imo.
« Last Edit: November 05, 2012, 07:07:56 pm by [MAF]Karlis »

Offline [MAF]Epoxi

Re: Crazybob's Points Map
« Reply #77 on: November 05, 2012, 09:07:30 pm »
I don't think FTLK supports alpha transparency, but I will try to implement the code blending with black or something.

How is the data collection from the server coming along?

Offline [MAF]Karlis

Re: Crazybob's Points Map
« Reply #78 on: November 05, 2012, 09:20:06 pm »
nothing still, none of us have a clue why it doesn't work and debugging fails to show any errors too :(
the worst part is i cannot reproduce the issue in local server, but ax becomes unusable if i test here, so i dunno what to do atm, i'll have some more free time in wednesday, will try some more then.

Offline [MAF]Epoxi

Re: Crazybob's Points Map
« Reply #79 on: November 05, 2012, 09:49:39 pm »
Cool, thanks.  ;D

Offline [MAF]Epoxi

Re: Crazybob's Points Map
« Reply #80 on: November 06, 2012, 04:45:49 pm »
I couldn't get the alpha blending to work.  :-[ But I added the ability to toggle white dots like on the original C'n'R image, plus the ability for the user to read the N count of points in a certain cell using the mouse (see top left hand corner of window below).


Offline [MAF]Epoxi

Re: Crazybob's Points Map
« Reply #81 on: November 10, 2012, 09:06:53 pm »
woot woot you can now make the canvas bigger than the window and drag around the plot produced.  ;D



Can you tell where that is?  ;)

Offline [MAF]mooman

  • Leader
  • Posts: 6,299
    • View Profile
Re: Crazybob's Points Map
« Reply #82 on: November 10, 2012, 09:25:32 pm »
wang's!

took me a while when it was so obvious :/
will read and answer your forum PMs when I'm less busy!

Offline [MAF]Epoxi

Re: Crazybob's Points Map
« Reply #83 on: November 10, 2012, 09:47:07 pm »


wang's!



Your prize is an assignment to get me some data from the server.  :L

If you want blue trails I need playerid,X,Y, otherwise points just need X,Y.
Values separated by tab spaces/commas doesn't matter I can deal with it. But I need each data point on a new line: makes debugging easier.

Pretty Please.  ^-^
I really wanna see this in action for real.
« Last Edit: November 10, 2012, 09:53:00 pm by [MAF]Epoxi »

Offline [FSR]Ush

  • Admin
  • Posts: 13,449
  • Aart
    • View Profile
Re: Crazybob's Points Map
« Reply #84 on: November 11, 2012, 01:01:03 pm »
wang's!

took me a while when it was so obvious :/

haha lol I tried to identify before I read your answer.. was looking where that upper turn could be, and where that other dead end is xD didn't realize wangs at first either, while it is so obvious :L

Offline [MAF]mooman

  • Leader
  • Posts: 6,299
    • View Profile
Re: Crazybob's Points Map
« Reply #85 on: November 11, 2012, 01:49:44 pm »


wang's!



Your prize is an assignment to get me some data from the server.  :L

If you want blue trails I need playerid,X,Y, otherwise points just need X,Y.
Values separated by tab spaces/commas doesn't matter I can deal with it. But I need each data point on a new line: makes debugging easier.

Pretty Please.  ^-^
I really wanna see this in action for real.
heh well i'm busy with something else atm (highscores system) but i'll do this after if karlis hasn't already fixed the strange bug by then
will read and answer your forum PMs when I'm less busy!

Offline [MAF]Epoxi

Re: Crazybob's Points Map
« Reply #86 on: November 11, 2012, 04:32:45 pm »
Thank you.  ;)

Offline [MAF]Karlis

Re: Crazybob's Points Map
« Reply #87 on: December 04, 2012, 05:58:52 pm »
and just about month later, i finally fixed it WOO
here is detailed info on how to read it, i'm including some code examples:
Code: [Select]
playerid,score_log2,damage,x_delta,y_deltaplayerid
  -player id, used to link "paths" together
  -if its above max players value(which is 54 atm, due to bots) then player is in stunt and substract 54 from the value to get actual id
Code: [Select]
#define MAX_PLAYERS 54
bool in_stunt = bool(MAX_PLAYERS/playerid);
playerid %= MAX_PLAYERS;
-there is no time value, as only relativity matters and you can increase global time when particular id is called second time
Code: [Select]
#define MAX_PLAYERS 54
unsigned long global_time = 0; //not sure if long needed, but better safe than sorry
unsigned long time_id[MAX_PLAYERS];
for(int i=0; i<MAX_PLAYERS; i++)
  time_id[i] = 0;

int getTime(int id)
{
  int delta = global_time - time_id[id];
  if(!delta) {
    global_time++;
  } else if(delta>1){
    new_race_started_for_player(id); //maybe not needed
  }
  time_id[id] = global_time;
  return global_time;
}
  -there is no player join/quit output, but you can assume when that happened using changes in score_log2 or presence of big difference in time
 -in race mode logging happens only while race is running, in stunt - all the time

player_log2
 -simple value that shows log2 from players' score, can be useful for analyzing driving differences between various levels of noobness
 -can be used to detect different player join or login
one more usage you have to figure on your own

damage
 -players' vehicle damage, in range 0-1000, -1 means player is on foot

x_delta
 -players' x delta since last second called
 -if there's line drawing between the points, check for distance between them and discard for too big one
 -remains its state between players joining and quiting, deltas are reset when line 'delta_reset' is written, basically just on server restart.

y_delta
 -same as above, but for y

it has been running since yesterday, but there were few more things to change so proper logging will start today.
most likely there will be some changes to come, but i will try to make them backwards compatible.
it might seem strange to have such static info feed, but this makes buffering before write much easier and less ram eating.
« Last Edit: December 04, 2012, 06:05:04 pm by [MAF]Karlis »

Offline [MAF]Epoxi

Re: Crazybob's Points Map
« Reply #88 on: December 04, 2012, 06:38:37 pm »
Wow thanks! That's so cool.  O0

I understand the deltas and all, but how do I find where a player starts from to make it meaningful?

Offline [MAF]Karlis

Re: Crazybob's Points Map
« Reply #89 on: December 04, 2012, 06:43:11 pm »
new_race_started_for_player(id) means that player has new run/race started in the example, and the deltas just remain deltas unless the line 'delta_reset' is written, so you can always get absolute x and y by starting from beginning and adding deltas.