• What are you working on? v15
    5,001 replies, posted
  • [QUOTE=Awwent;27164372]how do you clear[/QUOTE] From what I've read, aside from system("cls"); (There's a pretty huge security issue here, someone can just replace the cls command with anything they want) you can either use the curses or ncurses to clear the screen or do this: [code]int i; for ( i = 0; i < SCREEN_HEIGHT; i++ ) putchar ( '\n' );[/code] where SCREEN_HEIGHT is the number of rows that your command prompt/terminal has. [editline]2nd January 2011[/editline] I'd recommend curses/ncurses though, it probably contains a lot of functionality you'd want for making a game like that (I'm assuming, I've never used those libraries before)
  • I'm trying to sort the entities in my scene by their property called, well, depth. I was wondering what the best algorithm for sorting by a number is. I've heard things about QuickSort and Radix, but I'd love some opinions.
  • Hey, a quicksort/heapsort hybrid would be best. What language are you using? (Chances are it already has a highly optimized sorting function.)
  • uploading some content to youtube, but it will take a while. Will probably cancel it and do it tomorrow, or is there any free good .avi compressor?
  • [QUOTE=NorthernGate;27165555]I'm trying to sort the entities in my scene by their property called, well, depth. I was wondering what the best algorithm for sorting by a number is. I've heard things about QuickSort and Radix, but I'd love some opinions.[/QUOTE] Bogosort.
  • How big is the data set you're going to sort? If it's small just use selection sort. Go through the list and find the highest element, insert to another list. And repeat until the first list is empty.
  • [QUOTE=NorthernGate;27165723]C#, I've got all my entities stored in a dictionary: Dictionary<String,Entity>.[/QUOTE] Hey, 2 things: 1) You won't be able to sort the dictionary itself because it's an associated container; you'll have to create a List<Entity> (or similar). 2) Use C#'s Sort() function, it's a rather optimized version of quicksort. It would take a [i]lot[/i] of effort to write something faster than it.
  • [QUOTE=NorthernGate;27165555]I'm trying to sort the entities in my scene by their property called, well, depth. I was wondering what the best algorithm for sorting by a number is. I've heard things about QuickSort and Radix, but I'd love some opinions.[/QUOTE] [editline]2nd January 2011[/editline] Fucking broke my merge :(
  • [QUOTE=Jawalt;27165796]How big is the data set you're going to sort? If it's small just use selection sort.[/QUOTE] Hey, for small data sets, insertion sort is much quicker than selection sort. In fact, IIRC, std::sort is a hybrid of insertion sort, quick sort, and heap sort (but that doesn't apply to C#).
  • I was just suggesting a common sort, on very small lists even bubble sort is fine.
  • I hate Binary Coded Decimal :smith:: [cpp] INS(adc) { unsigned short total = (unsigned short)cpu->regs.a + (unsigned short)param + (GET_FLAG(cpu, FCARRY) ? 1 : 0); if(GET_FLAG(cpu, FBCD)) { cpu->regs.a += (param & 255) + (GET_FLAG(cpu, FCARRY) ? 1 : 0); FLAG_IF(cpu, FCARRY, total > 255); FLAG_IF(cpu, FZERO, cpu->regs.a == 0); FLAG_IF(cpu, FNEG, cpu->regs.a & 128); FLAG_IF(cpu, FOFLOW, (cpu->regs.a > 0) != (total > 0)); } else { // binary coded decimal mode eeek cpu->regs.a = (total / 10) << 4 + (total % 10); } } [/cpp]
  • Iris content: - Generating a 10000 x 10000 map. - Temporary start screen. - Loading screen. x - No collision detection yet (almost) x -Can move diagonal for some dumb reason. [media]http://www.youtube.com/watch?v=IinHuZDcPwI[/media]
  • [media]http://www.youtube.com/watch?v=nyI6WTvNY00&feature=feedu[/media] Can't be bothered to upload the video just so I can embed it. OH FINE I'LL UPLOAD IT. Finally finished sprite animation, my method of loading frames and animations is kind of half assed as I kind of just "made it work" rather than thinking out an ideal system, but eh, its not obsolete, its still a pretty good sprite handler and I'm quite proud of my work. Tomorrow I'll be working on.. Well to be honest I'm not sure. So far I have a good framework for the game (rendering, input, entity classes, etc..), so I'm thinking I'll add either maps or physics, it really just comes down to which one I'll be doing first! My plan is to finish maps and physics, and then add script integration (Probably Lua, just because I'm familiar) to handle scripted events (Obviously :rolleyes:) like light switches, AI routines, etc.. Oh and I plan to have semi-tile based maps, with which I'll implement a sort of 2D shader by just making tiles that are further away from light sources draw colors turn closer to black. Busy busy bee :buddy: [editline]3rd January 2011[/editline] [QUOTE=likesoursugar;27166131]Iris content: Generating a 10000 x 10000 map. No collision detection yet (almost) Can move diagonal for some dumb reason. [/QUOTE] I don't mean to be rude but the way the grass sits on top of the hills just looks horrible. Though I'm kind of guessing that its temporary while you work on the harder stuff?
  • Gave my test 6502 computer a 32x8 'screen' that's mapped into RAM at 0x200 - 0x2FF. The idea is that anything not directly related to the CPU (I'm going to call this the machine profile) is in init_6502.c. Later on I'll rework this to dynamically load a .so file and invoke the init_6502() in that. [img]http://ahb.me/1lSu[/img] Here's the assembly source for the image executing in the picture above: [code].segment "CODE" ldx #0 ldy #0 loop: txa cmp #14 bcc skipset lda #0 skipset: tax lda msg,x sta $200,y inx iny jmp loop isr: rti msg: .byt "Hello, World! ", $0 .segment "VECTORS" .word isr, isr, isr[/code]
  • (Repost?) This tool randomly generates 8-bit sound effects for use in games. [url]http://www.drpetter.se/project_sfxr.html[/url]
  • Just finished up Luigi, a Cr-48 firmware toolkit: [url]http://hexxeh.net/?p=328117655[/url] [media]http://www.youtube.com/watch?v=Iin-rXqSQXk&feature=player_embedded[/media] Allows you to reflash the firmware on your Cr-48 with a custom one that allows you to boot any OS.
  • [QUOTE=Hexxeh;27167379][media]http://www.youtube.com/watch?v=Iin-rXqSQXk&feature=player_embedded[/media][/QUOTE] Wow, nice work! Made all the more awesome by the music, too.
  • I couldn't sleep, it's currently 2:00 AM and I gotta go to school at 7:00 AM. Since I'm gonna fall asleep in school, I figured I should do something productive while awake. I've been re-doing systems of beat tapper these past few days, making the class structure more flexible. In doing this I had a chance to re-do the menu. [img]http://i53.tinypic.com/z337o.jpg[/img] [img]http://i55.tinypic.com/2s0b6ah.jpg[/img] Dark Grey: Folders Light Grey: Folder (currently selected) White: Song Yellow: Song (currently selected) Blue: Loaded Song Light Blue: Loaded Song (currently selected) I also worked on an Input Manager making things a lot easier. This means that I can (hopefully more easily) add in controller/dance pad support. :D
  • Anyone know of a Motorola 6800 assembler? Edit: Can't find a standalone assembler that's open source. So: [url]http://docs.google.com/viewer?a=v&q=cache:A-rfkZ-QKloJ:bytecollector.com/archive/digital_group/documentation/hardware/dg_systems/system_cards/6800_cpu_card/6800_Instruction_Set.PDF+motorola+6800+instruction+set&hl=en&gl=ca&pid=bl&srcid=ADGEESh9x1bYI4BEBS5c9OFYHq9R-6GsYx4x5PHyILmbh3MtvKIMSNzhYFcQKzoEj1W3Dbg5hjw2eIFv4-0lrmLUChY30xlkY6CccgCX7kGUcH5Xpwu_ozpBEl-p50FeAmT2GlLWIwd9&sig=AHIEtbSUSHPqeNz_mmJwyv-oTkCbtFRgOA[/url]
  • [QUOTE=Jawalt;27165857]I was just suggesting a common sort, on very small lists even bubble sort is fine.[/QUOTE] Hey, my bad, I thought you were actually suggesting selection sort over quick sort. My point was that quick sort is not in any way slow for small data sets, but insertion sort is usually faster than it for small data sets.
  • I was about to complain that I wasn't in the highlights (hardly surprising) but then I noticed I got the award for best avatar :3: I'm glad you like it.
  • [QUOTE=Hexxeh;27167379]Just finished up Luigi, a Cr-48 firmware toolkit: [url]http://hexxeh.net/?p=328117655[/url] [media]http://www.youtube.com/watch?v=Iin-rXqSQXk&feature=player_embedded[/media] Allows you to reflash the firmware on your Cr-48 with a custom one that allows you to boot any OS.[/QUOTE] Was too mesmerized looking at your avatar while listening to the music, other than that: awesome. [QUOTE=likesoursugar;27166131]Iris content: - Generating a 10000 x 10000 map. - Temporary start screen. - Loading screen. x - No collision detection yet (almost) x -Can move diagonal for some dumb reason. [media]http://www.youtube.com/watch?v=IinHuZDcPwI[/media][/QUOTE] Looks a ton like lewt.
  • [QUOTE=likesoursugar;27166131]Iris content: - Generating a 10000 x 10000 map. - Temporary start screen. - Loading screen. x - No collision detection yet (almost) [B]x -Can move diagonal for some dumb reason.[/B] [media]http://www.youtube.com/watch?v=IinHuZDcPwI[/media][/QUOTE] Probably can be avoided by just doing an else if on the input checks. like, if up, else if right, else if left, else if down.
  • [QUOTE=Awwent;27163578]gonna make a text based game with c++ i just started out with c++ and i want to know how you do something that stays in the text thingy like this (poor paint): [img_thumb]http://v.yey.nu/7f0/57a68.png[/img_thumb] is there any framework or something for this im new to desktop programming[/QUOTE] I made a engine for text based games a while back, it uses lua as scripting language, handles input, output, colors, and more. And i also fixed security holes. Contact me if you want it :)
  • [QUOTE=Jallen;27170040]Probably can be avoided by just doing an else if on the input checks. like, if up, else if right, else if left, else if down.[/QUOTE] Yeah I know but that's not so nice. Because then 2 of the keys will be prioritised. But I'll take a look after I've done some other stuff
  • [QUOTE=sLysdal;27170149]I made a engine for text based games a while back, it uses lua as scripting language, handles input, output, colors, and more. And i also fixed security holes. Contact me if you want it :)[/QUOTE] How can something that simple have security holes?
  • [QUOTE=Combino;27170363]How can something that simple have security holes?[/QUOTE] The OS library in lua have security holes, as you can place direct system calls. These holes have also been patched in gmod. [editline]3rd January 2011[/editline] From lua documentation: [quote]os.execute([command]) Execute an operating system shell command. This is like the C system() function. The system dependent status code is returned. [/quote]
  • [QUOTE=Jallen;27170040][b]else if[/b][/QUOTE] -snip- [img]http://img255.imageshack.us/img255/2387/ss20110103152236.png[/img]