This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Messages - AaroneusTheGreat
Pages: 1 2 [3] 4 5 ... 20
31
« on: March 14, 2012, 02:02:25 am »
Three virtual machines running as a process, and two instances of folding at home SMP client running on the same machine, while running a web browser and paint to make the screen capture. I'm impressed with this little laptop. I'm folding 5 separate proteins right now. Virtualization is amazing stuff. I am finally using all of my system's resources. Surprisingly, it's still responsive with the cpu running full out like that.
32
« on: February 26, 2012, 11:04:34 pm »
Just in case the theme throws you off, I'm running Windows 7 on this laptop, I just have the visual themes turned off for performance reasons. This laptop is part workhorse and part gaming system, so I keep it running the bare minimum.
33
« on: February 26, 2012, 06:39:25 pm »
If any of you can spot what I did wrong, I would greatly appreciate it. I'm not sure what's going on with this, but I haven't looked into it too deeply yet.
This part works, it generates the file, with the correct tag and all that stuff.
void SaveGame(short type_of_game) { short i,x,y; const char const* filename = type_of_game ? "doasava" : "doasavb"; // size of file: short totalDataSize = sizeof(gameglobals) + 21 + (8 * MAX_LEVEL_SPRITES) + ((14 * NR_SPRITE_TYPE_DEFS) * 2) + (sizeof(FATSPRITE) * MAX_SPRITES) + (sizeof(SpriteStruct) * MAX_SPRITES) + (sizeof(SwitchStruct) * MAX_NR_SWITCHES) + (sizeof(GlassWall) * MAX_GLASS_WALLS) + (sizeof(ExplodingFalseWall) * MAX_NR_DOORS) + (sizeof(PushableWall) * MAX_NR_DOORS) + (sizeof(LockedDoor) * MAX_NR_DOORS) + (4 * TOTAL_NR_WEAPONS) + (4 * gg.nr_doors);
HSym hsym = SymAddMain(SYMSTR (filename)); if (hsym.folder == 0) return; SYM_ENTRY *SymPtr = (DerefSym(hsym)); SymPtr->handle = HeapAlloc(totalDataSize); if (SymPtr->handle == H_NULL) return; unsigned char *VarPtr = HLock(SymPtr->handle); if (VarPtr == NULL) return; *(unsigned short*)VarPtr = (totalDataSize - 2); VarPtr+=2; // 2
*(unsigned short*)VarPtr = fc.cam_xpos; VarPtr+=2; // 4 *(unsigned short*)VarPtr = fc.cam_xpos; VarPtr+=2; // 6 *(unsigned short*)VarPtr = fc.cam_orientation; VarPtr+=2; // 8 *(short*)VarPtr = nr_item_sprites; VarPtr+=2; // 10 *(short*)VarPtr = nr_static_sprites; VarPtr +=2; // 12 *(short*)VarPtr = nr_dynamic_sprites; VarPtr +=2; // 14 memcpy(VarPtr,&gg,sizeof(gameglobals)); VarPtr += sizeof(gameglobals); for (i = 0; i <MAX_LEVEL_SPRITES; i++) { *(short*)VarPtr = item_sprites[i]; VarPtr+=2; *(short*)VarPtr = static_sprites[i]; VarPtr+=2; *(short*)VarPtr = dynamic_sprites[i]; VarPtr+=2; *(short*)VarPtr = sprite_checked[i]; VarPtr+=2; } for (y = 0; y < NR_SPRITE_TYPE_DEFS; y++) { for (x = 0; x < 7; x++) { *(short*)VarPtr = sprite_action_steps[y][x]; VarPtr+=2; *(short*)VarPtr = sprite_action_nr_sprites[y][x]; VarPtr+=2; } }
for (i = 0; i < MAX_SPRITES; i++) { memcpy(VarPtr,&sprites[i],sizeof(FATSPRITE)); VarPtr+=sizeof(FATSPRITE); memcpy(VarPtr,&sprt_data[i],sizeof(SpriteStruct)); VarPtr+=sizeof(SpriteStruct); } for (i = 0; i < MAX_NR_SWITCHES; i++) { memcpy(VarPtr,&Switches[i],sizeof(SwitchStruct)); VarPtr+=sizeof(SwitchStruct); } for (i = 0; i < MAX_GLASS_WALLS; i++) { memcpy(VarPtr,&glass_walls[i],sizeof(GlassWall)); VarPtr+=sizeof(GlassWall); } for (i = 0; i < MAX_NR_DOORS; i++) { memcpy(VarPtr,&exploding_false_walls[i],sizeof(ExplodingFalseWall)); VarPtr+=sizeof(ExplodingFalseWall); } for (i = 0; i < MAX_NR_DOORS; i++) { memcpy(VarPtr,&push_walls[i],sizeof(PushableWall)); VarPtr+=sizeof(PushableWall); } for (i = 0; i < MAX_NR_DOORS; i++) { memcpy(VarPtr,&lockedDoors[i],sizeof(LockedDoor)); VarPtr+=sizeof(LockedDoor); } for (i = 0; i < TOTAL_NR_WEAPONS; i++) { *(short*)VarPtr = weapon_array[i]->have_weapon; VarPtr+=2; *(short*)VarPtr = weapon_array[i]->ammo; VarPtr+=2; } FATDOOR *doorsarray = FAT_GetDoorsArray(); for (i = 0; i < gg.nr_doors; i++) { *VarPtr = doorsarray[i].type; VarPtr++; *VarPtr = doorsarray[i].state; VarPtr++; *(unsigned short*)VarPtr = doorsarray[i].position; VarPtr+=2; }
*VarPtr = 0; // 15 VarPtr++; *VarPtr = 'd'; // 16 VarPtr++; *VarPtr = 'o'; // 17 VarPtr++; *VarPtr = 'a'; // 18 VarPtr++; *VarPtr = 's'; // 19 VarPtr++; *VarPtr = 0; // 20 VarPtr++; *VarPtr = OTH_TAG; // 21 HeapUnlock(SymPtr->handle); }
This part always generates a protected memory violation.
short LoadGame(short type_of_game) { short i,x,y; const char const* filename = type_of_game ? "doasava" : "doasavb"; // open file returns the pointer to the actual data in the file, past the size bytes. unsigned char* VarPtr = OpenFile(filename); if (VarPtr == NULL) return 0; fc.cam_xpos = *(unsigned short*)VarPtr; VarPtr+=2; // 4 fc.cam_xpos = *(unsigned short*)VarPtr; VarPtr+=2; // 6 fc.cam_orientation = *(unsigned short*)VarPtr; VarPtr+=2; // 8 nr_item_sprites = *(short*)VarPtr; VarPtr+=2; // 10 nr_static_sprites = *(short*)VarPtr; VarPtr +=2; // 12 nr_dynamic_sprites = *(short*)VarPtr; VarPtr +=2; // 14 memcpy(&gg,VarPtr,sizeof(gameglobals)); VarPtr += sizeof(gameglobals); for (i = 0; i <MAX_LEVEL_SPRITES; i++) { item_sprites[i] = *(short*)VarPtr; VarPtr+=2; static_sprites[i] = *(short*)VarPtr; VarPtr+=2; dynamic_sprites[i] = *(short*)VarPtr; VarPtr+=2; sprite_checked[i] = *(short*)VarPtr; VarPtr+=2; } for (y = 0; y < NR_SPRITE_TYPE_DEFS; y++) { for (x = 0; x < 7; x++) { sprite_action_steps[y][x] = *(short*)VarPtr; VarPtr+=2; sprite_action_nr_sprites[y][x] = *(short*)VarPtr; VarPtr+=2; } }
for (i = 0; i < MAX_SPRITES; i++) { memcpy(&sprites[i],VarPtr,sizeof(FATSPRITE)); VarPtr+=sizeof(FATSPRITE); memcpy(&sprt_data[i],VarPtr,sizeof(SpriteStruct)); VarPtr+=sizeof(SpriteStruct); } for (i = 0; i < MAX_NR_SWITCHES; i++) { memcpy(&Switches[i],VarPtr,sizeof(SwitchStruct)); VarPtr+=sizeof(SwitchStruct); } for (i = 0; i < MAX_GLASS_WALLS; i++) { memcpy(&glass_walls[i],VarPtr,sizeof(GlassWall)); VarPtr+=sizeof(GlassWall); } for (i = 0; i < MAX_NR_DOORS; i++) { memcpy(&exploding_false_walls[i],VarPtr,sizeof(ExplodingFalseWall)); VarPtr+=sizeof(ExplodingFalseWall); } for (i = 0; i < MAX_NR_DOORS; i++) { memcpy(&push_walls[i],VarPtr,sizeof(PushableWall)); VarPtr+=sizeof(PushableWall); } for (i = 0; i < MAX_NR_DOORS; i++) { memcpy(&lockedDoors[i],VarPtr,sizeof(LockedDoor)); VarPtr+=sizeof(LockedDoor); } for (i = 0; i < TOTAL_NR_WEAPONS; i++) { weapon_array[i]->have_weapon = *(short*)VarPtr; VarPtr+=2; weapon_array[i]->ammo = *(short*)VarPtr; VarPtr+=2; } FATDOOR *doorsarray = FAT_GetDoorsArray(); for (i = 0; i < gg.nr_doors; i++) { doorsarray[i].type = *VarPtr; VarPtr++; doorsarray[i].state= *VarPtr; VarPtr++; doorsarray[i].position = *(unsigned short*)VarPtr; VarPtr+=2; }
CloseFile(filename); // the game engine may not have the correct number of sprites to work with, so // set it to what we loaded from the file. fc.nr_sprites = gg.number_total_sprites; // this part here has to be here, because the texconfig pointers for each sprite // may be pointing to some random place in archive memory, that may not correspond // to the textures anymore, so I just use the function I already have to // set the current texture frame for the current animation, to set the // pointers back to what they should be. for (i = 0; i < fc.nr_sprites; i++) { SetSpriteToCurrentAnimationFrame(&sprites[i],&sprt_data[i]); }
return 1; }
34
« on: February 26, 2012, 12:11:57 am »
PROGRESS UPDATE: I've been spending a ton of time optimizing the game, and so far I've gotten the game engine compiling down to 49816 bytes, and it's faster than ever! Hopefully when I have the yet again rewritten save and load game features working, I'll be ready to release another alpha for testing. Right now, the save game feature works, but the code to load the game from the save file does not! :O I'm not really sure what's going wrong right now either.
35
« on: February 17, 2012, 08:32:01 pm »
The program executable is what I'm speaking of by the 52k bytes. I think I may be confusing people about the total size of the game. The executable files are only one of several files that are required to make the game run. I have 5 graphics files with 65k of images or so in each, one map file at around 20k, the fat engine library file at 54.6k, and a data file at just over 3k. So total, the game takes up quite a bit of space. I found a bug and fixed it today. I also redid some addressing stuff with a few structures and saved some more cycles. The game runs very smoothly right now. I'm quite pleased with how it's going.
36
« on: February 17, 2012, 04:57:32 pm »
Thanks for all the help! I did some modifications to the code again today and I got the program size down to 52573 bytes. I implemented your code in the above post, and it saved quite a bit of program space. I'm very encouraged with how much this has been optimized. I think I'm going to email you the current source so you can see what I've done and possibly find some things I may still be missing.
37
« on: February 16, 2012, 09:14:37 pm »
Interestingly enough, your emails got put in my spam folder. I didn't know you had written to me. I read through the optimization tutorial and followed several of the things it said to do in there, which incidentally was a lot of what you said in your emails now that I go to read them. I guess great minds think alike. And thanks for the help. I didn't think of a few of the things you mentioned in the emails. I'll try applying those as well.
38
« on: February 15, 2012, 08:09:39 pm »
Noticeably better. I don't know how much better exactly, but it seems quite a bit more responsive. I'm still working on it though, I have a few more ideas in mind of how to speed it up more. A lot of the speed issue is in connection with the massive amounts of data it has to keep up with. The save files alone have averaged in the 6 to 8 kilobyte range, which is just the vital info to make sure you get the state of the game back, that doesn't include any of the pointers to the images, or the arrays of numbers connected with how the actions for each character behave, or any of that.
So needless to say, having a method of keeping track of all this that allows for quick addressing is vital.
39
« on: February 15, 2012, 03:45:00 pm »
Thanks DJ! In fact: PROGRESS UPDATE: So I've done another massive rewrite to the code, I managed to save quite a bit with the program size. I've gotten it down to 55760 bytes. So I've got nearly 10kb of space left for features now. I've been reading up on a bunch of compiler switches, and tricks to speed up and slim down code. I think it might be time to send out another alpha version to see how stable things are. So far it seems as if my improvements have increased the stability of the code, it's having to compute less to address some things in memory, so in turn, less errors are possible with addressing. I've still got quite a bit to do. I'll keep you all informed.
40
« on: February 08, 2012, 01:52:38 pm »
I was caught rather off guard today, I logged in and saw my name on the top of a list in a news article and I was like wtf? Did I do something impressive when I wasn't looking? lol come to find out it's just 'cus I've been here forever.
41
« on: February 07, 2012, 01:58:44 pm »
Very impressive! I had to post this as my facebook status and write a short blurb telling people who you are. Awesome work on this! There were several times in that video where I laughed out loud due to the clever things you came up with, you know the kind of laugh that means "Ha! holy crap that was neato!".
42
« on: February 07, 2012, 01:27:17 pm »
yeah sure, that would actually be a big help! I'll do that right away
43
« on: February 07, 2012, 11:20:36 am »
That's alright, it happens. I sent you the alpha a few minutes ago. I'm interested to see what you find. I'm running into strange things with the code right now with new features I'm trying to add. I think I'm getting close to the limit, because it keeps giving me protected memory violation errors in weird places, and it shouldn't be. So I'm thinking what I'm going to have to do is go through the code with a fine toothed comb and try to optimize the heck out of it. It's going to be a big task, but I'm going to try my best. The problem is, the code is pretty tight for the most part and I'm still at 61800 something bytes. I am having to be really careful because I'm running out of space, and the game isn't complete yet!
I've got a couple of ideas of how to save space and such, so I'm going to give it a shot. Wish me luck!
44
« on: February 03, 2012, 02:40:04 pm »
Bill Nagel made a game called Nebulus for the 68k calculators, among a few other things. He is quite a talented programmer. Nebulus was one of the few grayscale 68k games to feature music and sound effects.
[EDIT]: My mistake. The Nebulus game was made by a guy named Geoffrey Anneheim. My apologies. My memory isn't always the best. I do remember something pretty impressive from Bill Nagel though.
45
« on: February 01, 2012, 04:01:49 pm »
Today the team reached yet another milestone! We've now folded over 400 work units! At the rate we're going, we fold on average 13 to 14 work units a day. My friend GraveKeeper just joined the team recently, running an instance of folding on his server machine and his laptop. I want to see if the team can make the top 500 in the project. we are currently 11549 out of 209056 which puts us in the 94th percentile in the world. Which is pretty impressive on it's own, but I want to see if we can get the team into the competitive ranks at the top. For one if the team makes news anywhere it could spark more interest in the calculator community, and two, it's very important work.
If you've been following this project and you've got a computer that runs quite a bit, like a desktop that you leave on all the time, or a laptop that you use quite a bit, then please join the team! I can walk you through the installation of the program, and rest assured, it can be paused when you need your full processor time back.
To give you an example of the impressive performance of this project's client program, I run two different instances of the client on my laptop, and I can still play SKYRIM on high quality graphics settings. This is on a laptop that doesn't have a dedicated graphics card, it's an integrated chip on the processor.
That means that this client is only using the waiting cycles of my processor, not slowing down my performance at all. I have no problems with performance because of the client. No excuses guys!!! :p Let's make history! Send me a personal message if you need help with installing anything.
The team number is 213973
You need to input this team number and a username in the configuration of the client in order to be counted as part of the team.
Pages: 1 2 [3] 4 5 ... 20
|