• What are you working on? v15
    5,001 replies, posted
It's that time again, that's right I'm talking about my garbage collector :v: I'm trying to clean up my collector quite a bit. The use of the C++ STL containers proved to be a bit heavy, and overall have caused a bit of an issue in terms of size, as well as my having to write a lot of fluff just to get everything to compile happily, so I ended up writing a few custom containers (such as a FIFO ring queue, and a static array), as well as an extra class or two to ensure I can still use the really awesome parts of the STL (like std::for_each, and my own synk::parallel_for_each, though I may be writing some more custom functions to work better, and let me cut some more slack). However, within my collector, the primary issue has been ensuring the collector runs without being too expensive. In the current code in the repo, there is the use of the condition variable, and a mutex. Because of this condition variable, it makes my collector unavailable to people on Windows XP. In addition, the actual act of locking a mutex, waiting on the condition then signaling it later is expensive (in the same way that performing N allocations one after the other rather than as one block is expensive). So in an attempt to make the collector lock free, I began looking at a user implemented spin lock of sorts. Turns out everyone out there tries to write one that can replace a semaphore or mutex, or some other real lockable type, but we don't want a real lock, in the sense that we stop multiple threads from accessing a shared resource. I have no need for these, because I've tried to keep the actual collection cycle parallel, that is any given operation fauxtomic, or is capable of being independent of every other operation on the given data set, but in actuality not truly atomic, so all I ended up doing is putting in a fancy while loop that yields the collector thread when there is no work to be done. (This is Sleep(0) on windows, pthread_yield on linux, and pthread_yield_np on OS X/FreeBSD. There are some differences between each, but the result is the same) In the current tests I've run (which are admittedly only on OS X), I've seen the speed of the actual collection cycle double. Now these are by no means official benchmarks, but it seems promising so far :D (add in that the user level removal of a type is effectively distinct from the actual collector removal, and we get a truly concurrent collector) I'm getting closer and closer to a first stable release, and this is making me excited and want to talk about it.
[QUOTE=Ortzinator;27298428]Expect getting shit for BSP.[/QUOTE] Learning material only, I'll work on a custom map format when I'll have time to code an editor to go along.
Would anyone mind telling me whats wrong with using BSP as a map format?
Where did you figure out how to parse the BSP file format
Is there a way for me to include two things co-dependent on each other? For example: I need to include Lukui::Game in my Lukui::Screen class and Lukui::Screen in Lukui::Game but I can't because I'll get C2061.
In C/C++ forward declare them by simply writing 'class Game;' before you use it then implement it later.
[QUOTE=Jookia;27299231]In C/C++ forward declare them by simply writing 'class Game;' before you use it then implement it later.[/QUOTE] Thanks. Can't believe I forget this shit.
[QUOTE=DarkCybo7;27298747]Where did you figure out how to parse the BSP file format[/QUOTE] [url=http://www.flipcode.com/archives/Quake_2_BSP_File_Format.shtml]This[/url] could be a start.
In the past hour I just made this little console effect. Stars flood the screen then get blasted away by a huge white wave [csharp] using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; namespace matrix { class Program { // Config static readonly string chars = "01"; static readonly int star_count = 300; static readonly int star_sleep = 5; static readonly int blast_backpath = 10; static readonly int blast_sleep = 0; static readonly char blast_char = '.'; static readonly char blast_front = '#'; static void Main(string[] args) { Console.WindowHeight = Console.LargestWindowHeight; Console.WindowWidth = Console.LargestWindowWidth; Console.WriteLine("Center Console and Press any key..."); Console.ReadKey(); Console.Clear(); Random rand = new Random(); for (int i = 0; i < star_count; i++) { Console.ForegroundColor = (ConsoleColor)rand.Next(9,16); int posx = rand.Next(Console.WindowWidth); int posy = rand.Next(Console.WindowHeight - 1); for (int x = 0; x < rand.Next(10); x++) { Thread.Sleep(star_sleep); Console.SetCursorPosition(posx, posy); Console.Write(chars[rand.Next(chars.Length)]); } } int[] stars = new int[Console.WindowHeight]; for (int i = 0; i < stars.Length; i++) { stars[i] = rand.Next(-blast_backpath, 0); } Console.ForegroundColor = ConsoleColor.White; for (int x = 0; x < Console.LargestWindowWidth + blast_backpath; x++) { for (int y = 0; y < stars.Length; y++) { stars[y]++; if (stars[y] > 0 && stars[y] < Console.LargestWindowWidth) { Thread.Sleep(blast_sleep); Console.SetCursorPosition(stars[y] - 1, y); if (rand.Next(0, 20) == 0) { Console.Write(blast_char); } else { Console.Write(' '); } Console.SetCursorPosition(stars[y], y); Console.Write(blast_front); } } } Thread.Sleep(500); Console.Clear(); Console.ForegroundColor = ConsoleColor.Gray; Console.SetCursorPosition(0, 0); Console.WriteLine("Thanks for Watching"); Console.ReadKey(); } } } [/csharp] A nice content start to a new page. So a image is in order... [img]http://dl.dropbox.com/u/2014606/console_screenshot.png[/img]
Has anybody else's display drivers started killing themselves when they attempt to run vs2010? Edit: Only crashes when I create a new C++ win32 application
[QUOTE=Jimmylaw;27300910]Has anybody else's display drivers started killing themselves when they attempt to run vs2010? Edit: Only crashes when I create a new C++ win32 application[/QUOTE] Seems to be fine for me xD... sure you've not downloaded the wrong bit version :P? ^ Thanks for rating this dumb even though it was obviously sarcasm...
[QUOTE=graymic;27301304]Seems to be fine for me xD... sure you've not downloaded the wrong bit version :P?[/QUOTE] Its worked perfectly for the past year.
[QUOTE=Kopimi;27298743]Would anyone mind telling me whats wrong with using BSP as a map format?[/QUOTE] It's outdated and loads slowly, that's why Source always takes ages to load maps. Alternatives: [url]http://en.wikipedia.org/wiki/Template:CS_trees[/url]
Working on animating my 2D perlin noise I get the feeling i could be doing it better when i ended up with a 4 dimensional array.
[QUOTE=Nipa;27296673]About the subject of coding on the iPod touch, it's possible. Get MobileTerminal and the gcc package (which is around 90MB), and then you can use a text editor of choice to create a file and compile it with gcc. This means you can code C on the device, but it'll be terminal only.[/QUOTE] Hey, this is very interesting; can you recommend a good text editor for the iPod touch? I tried gTxtEdit 2.0 but it doesn't work very well, and it doesn't support landscape mode.
Overv, I'm ready for your app now: [img]http://anyhub.net/file/1q9E-dscn2623.jpg[/img]
Is that Android on iPhone? Sweet, didn't know you can do that.
[QUOTE=CarlBooth;27305150]Overv, I'm ready for your app now: [img_thumb]http://anyhub.net/file/1q9E-dscn2623.jpg[/img_thumb][/QUOTE] Good luck, considering that iDroid is laggy without video drivers, and there's no Android Market.
[QUOTE=Darwin226;27305208]Is that Android on iPhone? Sweet, didn't know you can do that.[/QUOTE] That's an iPod Touch but it also works on iPhone 2G and iPhone 3G [QUOTE=DeadKiller987;27305216]Good luck, considering that iDroid is laggy without video drivers, and there's no Android Market.[/QUOTE] It runs fine on here.
[QUOTE=CarlBooth;27305234]That's an iPod Touch but it also works on iPhone 2G and iPhone 3G It runs fine on here.[/QUOTE] That's.. beautiful. How did you accomplish this? I have an 1G iPod Touch and am tired of iOS.
[QUOTE=DarkCybo7;27298747]Where did you figure out how to parse the BSP file format[/QUOTE] Unofficial Quake 3 Map Specs: [url]http://www.mralligator.com/q3/[/url] Rendering Quake 3 Maps: [url]http://graphics.cs.brown.edu/games/quake/quake3.html[/url] Loading and Rendering Quake 3 Arena Maps: [url]http://www.vicampus.com/index.php?action=showtutorial&id=8[/url] Lightmaps in Quake 3 Arena: [url]http://www.vicampus.com/index.php?action=showtutorial&id=9[/url] HL2 BSP Lightmap Coordinates: [url]http://www.gamedev.net/community/forums/topic.asp?topic_id=581817[/url] Source BSP File Format: [url]http://developer.valvesoftware.com/wiki/Source_BSP_File_Format[/url] Packing Lightmaps: [url]http://www.blackpawn.com/texts/lightmaps/default.html[/url] [url]http://www2.ati.com/developer/gdc/D3DTutorial10_Half-Life2_Shading.pdf[/url] [url]http://www.valvesoftware.com/publications/2006/SIGGRAPH06_Course_ShadingInValvesSourceEngine.pdf[/url] All these were very helpful for me.
What's the status of Fortblox, layla?
[QUOTE=CarlBooth;27305234] It runs fine on here.[/QUOTE] On my iPhone 2G It lags even on the unlock screen :saddowns:
Does anyone know any useful tools for recording videos of things? i got my animation working :D
[QUOTE=Jallen;27305795]What's the status of Fortblox, layla?[/QUOTE] Making UI widgets for the server browser and what-not, nothing worth showing.
[QUOTE=Icedshot;27305843]Does anyone know any useful tools for recording videos of things? i got my animation working :D[/QUOTE] Fraps, maybe Camtasia
[QUOTE=Icedshot;27305843]Does anyone know any useful tools for recording videos of things? i got my animation working :D[/QUOTE] Fraps or GameCam
[QUOTE=Icedshot;27305843]Does anyone know any useful tools for recording videos of things? i got my animation working :D[/QUOTE] CamTasia.
[QUOTE=Icedshot;27305843]Does anyone know any useful tools for recording videos of things? i got my animation working :D[/QUOTE] If its not ingame/fullscreen then i prefer camstudio, you then port it into moviemaker, save with recommended settings and it should be of acceptable size, if it is fullscreen then fraps
Fraps captures anything that renders with OpenGL or DX. Fullscreen not needed.
Sorry, you need to Log In to post a reply to this thread.