|
SodiumEyes
|
|
« Reply #3741 on: May 19, 2014, 11:12:28 AM » |
|
Added a visible trail behind the player I think it really adds to the sense of movement
|
|
|
Logged
|
|
|
|
Graham-
|
|
« Reply #3742 on: May 19, 2014, 11:24:04 AM » |
|
I think I'm cured of oo-itis.
be careful. it hibernates.
|
|
|
Logged
|
|
|
|
Code_Assassin
|
|
« Reply #3743 on: May 20, 2014, 08:47:20 PM » |
|
Figured out how to prevent my TUI in cmd.exe from flickering. Even though I'm not clearing the entire screen, and only certain elements the console still exhibits signs of flickering. So, why not double buffer the console? Thanks to some low-level kernel32.dll calls, it works like a charm.
Really glad to have spent some time refactoring and getting the TUI in order. Onto networking!
|
|
|
Logged
|
|
|
|
Geti
|
|
« Reply #3744 on: June 16, 2014, 06:57:01 AM » |
|
Found a typo that was locking some prototype systems at a way lower tick rate than intended - nice to see it jump from 17fps to 60fps without breaking a sweat (<5% CPU utilisation), even with TTF rendering and the like mixed in there. Annoying that the typo was in there in the first place, but I can at least get to sleep a happy man.
|
|
|
Logged
|
|
|
|
Geti
|
|
« Reply #3745 on: June 27, 2014, 08:11:12 AM » |
|
/////////////////////////// // Hash Example code /////////////////////////// /* using namespace hash; //construct Hash h = createHash<char*>(); char** temp; //add add<char*>(h, "hello", 1); add<char*>(h, "world!", 3); add<char*>(h, "there", 2); //iteration + getting elements for(begin(h); !end(h); next(h)) { temp = current<char*>(h); } //reverse iteration + getting keys for(rbegin(h); !rend(h); prev(h)) { ID i = currentKey(h); } //find temp = lookup<char*>(h, 1); //hello temp = lookup<char*>(h, 2); //there temp = lookup<char*>(h, 3); //world! //remove remove(h,3); remove(h,2); remove(h,1); //free FreeHash(h); */ ///////////////////////////
Got all of this Hash code working (along with a similar List structure and interface) in a day and a half's spare time. Particularly pleased with the iteration stuff - looks a lot like STL iterators without the huge awful iterator declarations, because the container works as it's own iterator - if you need more than one iterator for the same container for some reason you can just make a simple data copy of the container because its type is a POD struct (with members considered read only in most cases). I'm taking the approach laid out by the bitsquid guys with their foundation code, putting related functions into a namespace rather than implementing everything as member functions, which has had the interesting side effect with these containers of allowing untemplated containers - all hashes are a Hash instead of a Hash<T>. I've yet to discover if this is a bad thing or not :^) I'm still unsure if I really enjoy this kind of "low level" work or not, but it's nice to see it working either way.
|
|
|
Logged
|
|
|
|
InfiniteStateMachine
|
|
« Reply #3746 on: June 27, 2014, 11:18:47 PM » |
|
I think I'm cured of oo-itis.
be careful. it hibernates. hahah don't worry, I'm pretty sure it's dead. Unless I'm using a language where I'm forced.
|
|
|
Logged
|
|
|
|
Rhatos
|
|
« Reply #3747 on: June 29, 2014, 03:28:12 AM » |
|
I finally figured out how to make my guy shoot in the other direction in Game maker
|
|
|
Logged
|
|
|
|
Geti
|
|
« Reply #3748 on: June 29, 2014, 03:41:29 AM » |
|
Haha, welcome to the thread congrats.
|
|
|
Logged
|
|
|
|
gamerzap
|
|
« Reply #3749 on: June 30, 2014, 09:41:27 AM » |
|
I've been making a raycaster for a game, and even with no walls at first it was getting 8 FPS. I did a bit of optimizing and got it up to 45ish. Still more to go, but I'm pretty happy I was able to make that much of a difference in it.
|
|
|
Logged
|
|
|
|
Slader16
|
|
« Reply #3750 on: June 30, 2014, 03:45:18 PM » |
|
I finally figured out how to sort an array, took me 2 weeks but I did it!
|
|
|
Logged
|
|
|
|
Geti
|
|
« Reply #3751 on: June 30, 2014, 04:50:24 PM » |
|
Haha, times like these I'm glad to have been formally taught that stuff as part of my degree. Congrats for working it out on your own, but be careful that you're doing it a performance conscious way, there are fast ways and slow ways to sort data. I've been making a raycaster for a game, and even with no walls at first it was getting 8 FPS. I did a bit of optimizing and got it up to 45ish. Still more to go, but I'm pretty happy I was able to make that much of a difference in it. congrats, remember you can always parallelise that sort of rendering for a very healthy speed up too.
|
|
|
Logged
|
|
|
|
Slader16
|
|
« Reply #3752 on: June 30, 2014, 05:22:30 PM » |
|
Haha, times like these I'm glad to have been formally taught that stuff as part of my degree. Congrats for working it out on your own, but be careful that you're doing it a performance conscious way, there are fast ways and slow ways to sort data. I've been making a raycaster for a game, and even with no walls at first it was getting 8 FPS. I did a bit of optimizing and got it up to 45ish. Still more to go, but I'm pretty happy I was able to make that much of a difference in it. congrats, remember you can always parallelise that sort of rendering for a very healthy speed up too. Well I don't feel 100% confident that it's the best way to do it. I'm using array.orderBy() in a void Update (Is that a bad thing?)
|
|
|
Logged
|
|
|
|
Geti
|
|
« Reply #3753 on: June 30, 2014, 05:30:53 PM » |
|
What you just asked is incredibly domain specific (Arrays in C aren't "objects", for example, and raw arrays in C++ aren't either, and Arrays in ActionScript are objects but have different methods, and so on) but, assuming you mean C# arrays, it should be fine for small collections.
If you want to avoid the overhead of creating a new array and sorting data into that (which would be important if your array is like, megabytes large) you might want to use array.Sort but people seem to feel that array.Sort gets messy quickly.
With my comments about doing it in a performance conscious way I had assumed you implemented your own sorting algorithm - and if you aren't aware of the theory there it's easy to write a slow sort. If you're using library implementations it's usually a safe bet that they're using one of the fast algorithms.
|
|
|
Logged
|
|
|
|
Slader16
|
|
« Reply #3754 on: June 30, 2014, 05:37:58 PM » |
|
What you just asked is incredibly domain specific (Arrays in C aren't "objects", for example, and raw arrays in C++ aren't either, and Arrays in ActionScript are objects but have different methods, and so on) but, assuming you mean C# arrays, it should be fine for small collections.
If you want to avoid the overhead of creating a new array and sorting data into that (which would be important if your array is like, megabytes large) you might want to use array.Sort but people seem to feel that array.Sort gets messy quickly.
With my comments about doing it in a performance conscious way I had assumed you implemented your own sorting algorithm - and if you aren't aware of the theory there it's easy to write a slow sort. If you're using library implementations it's usually a safe bet that they're using one of the fast algorithms.
Yeah I'm using Unity C# But the problem is that I'm sorting through an array that can be potentially huge.
|
|
|
Logged
|
|
|
|
Graham-
|
|
« Reply #3755 on: June 30, 2014, 09:45:20 PM » |
|
I think I'm cured of oo-itis.
be careful. it hibernates. hahah don't worry, I'm pretty sure it's dead. Unless I'm using a language where I'm forced. My rough solution is this: 1. Laziest implementation first. 2. Upgrade by necessity of feature, or provable increase in elegance. But I still fuck it up.
|
|
|
Logged
|
|
|
|
gamerzap
|
|
« Reply #3756 on: July 01, 2014, 03:45:20 AM » |
|
Haha, times like these I'm glad to have been formally taught that stuff as part of my degree. Congrats for working it out on your own, but be careful that you're doing it a performance conscious way, there are fast ways and slow ways to sort data. I've been making a raycaster for a game, and even with no walls at first it was getting 8 FPS. I did a bit of optimizing and got it up to 45ish. Still more to go, but I'm pretty happy I was able to make that much of a difference in it. congrats, remember you can always parallelise that sort of rendering for a very healthy speed up too. Yeah, I know, but this is just a small project and I'm using java and I don't want to get into GPU stuff for it. I might later on if it needs the speed boost, though.
|
|
|
Logged
|
|
|
|
Geti
|
|
« Reply #3757 on: July 01, 2014, 03:21:18 PM » |
|
Ignoring the gpu, Java has really easy threading that you could be using to double or quadruple the rendering speed.
|
|
|
Logged
|
|
|
|
gamerzap
|
|
« Reply #3758 on: July 01, 2014, 04:54:04 PM » |
|
Ignoring the gpu, Java has really easy threading that you could be using to double or quadruple the rendering speed.
Oh, thanks, I didn't even think of that :D I'll have to try and implement that later.
|
|
|
Logged
|
|
|
|
dancing_dead
|
|
« Reply #3759 on: July 03, 2014, 01:17:39 AM » |
|
|
|
|
Logged
|
|
|
|
|