Jump to content
  • Advertisement

mozie

Member
  • Content count

    304
  • Joined

  • Last visited

Community Reputation

194 Neutral

About mozie

  • Rank
    GDNet+
  1. mozie

    I love the morning!

    Yeah, mornings rock when I don't have to work. Wednesday night we had a few tornados in the area, I lost power at about 7pm that night. Nothing big really, a few trees down and the usual. The damage from this was nothing compared to what is currently going on in the gulf. This is really about how I lost my last mornings of joy. Thursday came around, and I get a call at 7am from my boss, he told me they do not have power yet and I should wait by my phone. I kindly informed him that I have today off, but thanked him for the information. I had to bring my girlfriend into work because bla bla bla early in the morning, at this time there were about 110,000 people in my area w/o power. So 1 out of 3 people are unshowered and looking for coffee, the local gas station was closed and all the ones I drove by were packed full. I was one of the unshowered in need of a pack of smokes and a cup of joe. Not that interisting, I know. Just getting to the point, I left home a little after 7am and arrived home around 10am, it took like 3 hours to get coffee and smokes. I tried to call my family to see if anyone needed help with some cleaning up, didn't get a hold of any of them. I decide to move my computer desk now that it's off, and I can't turn it on. It was fun, and I am happy that I have it where it is now, but I ended up sitting at home with no power until about 5pm. Then I had a serious game session, yay. Friday morning, I am scheduled to work at 9:30 am, I get another call around 7am telling me the same thing, and to keep my phone near by in case the situation changes. Woohoo! Free day off! I headed off to the super market to get a bag of coffee and something for lunch. I was all comfortable in my new setup, playing around with ADO.NET when I got another call, "we expect to have phones soon, so head in". That call came in at around 10 am, I took 30 minuets to get ready and headed into work for the day. I live near a major highway, and take it to work. I had to cross the highway to get my coffee this morning, and there were no problems, power was on all over the area. My work was on the other side of the river, so I just expected the general area was all back up. Not true, I have not gone south on the highway since going to work on Wednesday, three stop lights were out, so they were reduced to 4-way stops, it only took like 20-25 minuets to go the 4 miles I have to drive to get to work. When I get there, they don't really have power, just partial power. We had some 30 extention cords running around powering up CS workstations. They told us tech-support people that we would not have power to our workstations, that we would have to take notes on paper and just do all the support by memory and asking tons of questions. Good grief! We stood around for about 1 hour before we actually started taking calls. I understand that they want to be back in operation ASAP as a company, if customers can't call in orders as normal, they are losing money. However I also think they should have waited until they could say "ok, we are ready for you, come in now". Tomorrow I will see what time they clocked me in at, I think I should be getting paid for all the time I stood there being ready to goto work. I work until 6:30 pm, one of the other guys who works until 7 asked about breaks for the day, the first thing out of my bosses mouth was "well, we started late today..." and ended with no breaks. We were like WTF?! He came back about a minuet later and said, just make sure you only go one at a time. Thats more like it buddy, thank you! Shit, no breaks after starting only 1 hour late in a 9 hour day (normally minus 30 for lunch, but not today). Since I got there around 11, I was there for 7.5 hours, don't try to tell us we don't get a break. After that the day was pretty much ok, they brought in about 12 pizzas for us, so we didn't have to take a lunch. Because they were down for a day, they asked if some of us would work early/late on Saturday to help take calls, in hopes that customers who didn't get to order Thursday would try to call and our company might be able to pickup some "lost" orders. I work Saturday every week anyway, so I said I would work the extra hours late, because I don't like getting up on Saturday for work, my start time is 1.5 hours sooner than in the week, no way I was going to make it in 1 hour earlier than that. Saturday we had a generator and air compressor rented, the power company said since we have partial power and other places have none, we were on the bottom of the list. They said it would be 3-5 days (from Thursday) before power would be restored fully. Saturday was actually nothing to complain about really, we had a lot of extra people. I usualy get stuck on CS calls all the time and have to clear thoes before it will send in the TS queue. With all the extra people, it was really slow and I was able to poke around online when I was not on a call. Plus we only stayed 1 hour later than normal, insted of 3. The call volume was not as high as they had anticipated. My friends are having a baby, and I went to my first baby shower after work. It was boring. Sunday, this is soo much better. In my favorite spot, I have a nice playlist put together, just started drinking my 2nd pot, just finished putting summaries on two classes I made for my GTR File project, I couldn't be happier. I added support for multiple input files when importing to archive, and also a new file button. Infact I just found out about how to add summaries to my code. For all of you who don't know already, if you type three slashes "///" above a function or variable like you are going to comment it, it will fill in the "" tags for you. Makes it nice so you can comment for intellisense. I doubt many people are interested in this, but here are the two C# classes I made. They are not really finished, I am working on getting the DataBlock to be a MemoryStream insted of a byte array, so keep that in mind if you actually read the code. GTRFile.cs using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; using System.Runtime.InteropServices; using ICSharpCode.SharpZipLib; using ICSharpCode.SharpZipLib.Zip.Compression; using ICSharpCode.SharpZipLib.Zip.Compression.Streams; namespace GTR_File { /* * Class: GTRFile * Class for accessing elements stored withing the * .GTR files */ /// public class GTRFile { System.Int64 SIG_HIGH = 0x414d524f544f4d47; System.Int64 SIG_LOW = 0x0000000000303153; /// /// Number of items in file. /// public int items; /// /// Length of stored file in bytes. /// public int FileLength; /// /// The full path of file. /// public string sourceFileName; /// /// true if file has been Parsed, false if not. /// public bool parsed; /// /// The index in file of first DataBlock byte. /// private long DataOffset; /// /// The ArrayList holding our GTRFileItem collection. /// private System.Collections.ArrayList ItemArray; private System.Int64 SigHigh; private System.Int64 SigLow; /// /// Constructor. /// /// Name of file. /// bool, parse file after open. /// public GTRFile(string filename, bool parse) { ItemArray = new ArrayList(); parsed = false; sourceFileName = filename; if(parse) this.Parse(); } /// /// Create a new GTRFileItem. /// /// The new item. public GTRFileItem NewItem() { int item_n; item_n = ItemArray.Add(new GTRFileItem()); ++items; return (GTRFileItem)ItemArray[item_n]; } /// /// Get GTRFileItem for index number. /// /// Zero based index of item. /// The GTRFileItem for index. public GTRFileItem GetFileItem(int n) { if(n >= items) return (GTRFileItem)null; return (GTRFileItem)ItemArray[n]; } /// /// Reads the header for an existing .GTR file. /// /// /// The success of the operation. private bool ReadHeader(System.IO.BinaryReader breader) { try { if(!CheckSignature(breader)) return false; items = breader.ReadInt32(); FileLength = breader.ReadInt32(); } catch (Exception e) { MessageBox.Show(e.Message, "GTRFile::ReadHeader()"); } return true; } /// /// Reads the GTRFile Signature from an open binary reader. /// /// binary reader to read from, expects the reader to be /// seeked to the begining of the file. /// true if the signature matches, false if not. private bool CheckSignature(System.IO.BinaryReader breader) { try { SigHigh = breader.ReadInt64(); SigLow = breader.ReadInt64(); if(SigHigh == SIG_HIGH && SigLow == SIG_LOW) return true; MessageBox.Show("Signature Mismatch!", "GTRFile::CheckSignature()"); return false; } catch (Exception e) { string strMsg = e.Message; MessageBox.Show(strMsg,"GTRFile::CheckSignature()"); return false; } } /// /// Parses the GTR file, reads the file index and loads the items into ItemArray. /// /// The success of the operation. public bool Parse() { System.IO.FileStream infs; System.IO.BinaryReader breader; try { infs = new System.IO.FileStream(sourceFileName, System.IO.FileMode.Open ); breader = new System.IO.BinaryReader(infs); ReadHeader(breader); for(int i=0;i Secrest, out!
  2. mozie

    Not bad.

    You don't like bears?
  3. mozie

    Not bad.

    Ok, that was too easy... I love the mornings!! Coffee is my best friend until about noon, when my stomach starts to boil and I have to switch over to something like water, pop, or juice. But for the two hours I have left before that happens, I will work on removing an item from the file, and inserting at a point in the index other than the end. It just seems like that was way too easy. I just moved the decompression function into item class, because it has the DataBlock stored in itself now. After that it just became a matter of looping throught the array a few times to get the data I needed, in the order I need it. I'm thinking that removing an item from the "file" will just be a removal from the ArrayList, and overwrite the existing file, or save as new. Pretty much same thing with the insertion-at-index, I should be able to easily do that to the ArrayList, and again just overwrite or save as new from the updated list. Maybe I will make it to adding recompression with different level today, who knows. I guess I will upload source and exe files later tonight when I feel I'm done for the day. I still have to determine type code from file extention too, but here is a screenie for you. C5RICON.TGA is the file I imported into the original archive. Uploaded with release, and debug builds, with source code, and required DLL files.
  4. mozie

    Its a little better.

    Looking back, it makes sence that the data blocks are compressed. I was able to get SharpZipLib to do exactly what I wanted, and in minimal code. Really just a function call to the inflater and deflater, check the return code for errors and all was good. Extracting a file out of the archive is working great. I decided to move the decompression function into the class that reads and parses the file. I also added a place to store the datablock in the FileItem class. I think this will help when I finish the import routine, because I will need to rewrite the file, I will have to recalculate the offsets. Ok, so that does not really explain why.. but I will have the output routine in the class that has the ArrayList of FileItems, so it can write out the file index, and because the file uses an offset that starts at the end of the index I don't need to calculate it. It should go something like this, item.offset = sum_of_all_previous_items_lengths. The first index always has an offset of 0, this is handy. Anyways, I'm not much of a writer so I'll just get on to coding today. I hope I can finish the importing this morning. I came up with a funny question... When dealing with compressed files that are being read off of a hard disk, is it faster (with modern processors) to read in 9,000 bytes and decompress it in to memory, or read in the uncompressed 900,000 bytes stright in to memory? I know that the HDD is the slowest deice in the system, but 900,000 bytes isn't alot. I do think it is faster to decompress the chunk in memory, but I want to write a feature for this program that will rearchive the file with lower compression, to see if I am wrong. To see if the game actually loads faster because of the reduced compression. Too bad I probally will not be able to actually measure the difference. I can't think of anything other than my wrist watch that will be able to time the length of the loading screens for the game. Until next time.
  5. mozie

    Zoned out.

    And not long after that I bought GTR, and then a Logitech MOMO Racing wheel. I can't really say enough about how great a nice wheel is for racing game fans. So I won't. I will tell you that it finally got me up to coding again though. I have not really done alot of programming lately, so I decided to do a little 3rd-party app for my new favorite game. The challenge, extract files from a game data file. All was well, I found the signature, then the number of items, and the total file length. Followed by 256 bytes for each item, four for (what I think is) a type identifier, 4 bytes start offset, 4 bytes unknown (at this time) use, 4 bytes data block length, and finally two hundred and forty bytes for file name. Read all the items into an ArrayList for storage (in a class), and display the list in a ListBox. Simple enough. Read the data start offset and add that to the items offset, Read the length into a file. Well, the data I get isn't what I expected. I have an idea on what the unknown data field is, I think it is the uncompressed length of the file stored. I think that because the unknown field is always larger than the length field. I extracted a BMP file, and it was not correct, header was completly wrong. Ho-hum, compression seems like it would be pretty normal. Now I just hope its RLE, because everything else is a little complicated to just impliment on the fly into the tool. Looking at how 'simple' the data is stored in the file, I think it will be RLE but I have alot of research to do to find out what kind of compression this uses just by looking at the files data. RLE also seems likely because it would be easy to read and decompress at the same time. The data block always starts with 78 9C (hex) and the following two bytes seem to always fall on hex combinations of D and E, but have been observed to be different at times. If you know alot about RLE detection, or compression in general, and would like to help out email or PM me please! If you have GTR, you can download my little tool if you want to see what is inside the .GTR data files. GTR File (C#, requires .NET).
  6. mozie

    more

    The chapter on transactions seemed short. I guess that they just sound complicated. More likely they will get back to it later, and this is juat an introduction to them. Other sites have given the book some bad reviews, but I don't really care. Most of them were just talking about code errors. Newflash people, technical books have errors! Thats why they have errata on some website, the good ones do. Take it for what it is and learn from it. It's not intended to make you a master at everything ever in ADO.NET. I'm sure it would have to be 3 times thicker and would make actually just learning about it much much harder. If I like what I find in ADO.NET with this book, I might pick up the hard cover MS-Press book on the subject, named just "ADO.NET". Can't trust reviews on most places that only give the reviewer one paragraph to describe it. I'm also excited about my plan to finally take my MS certs this winter. Yay!
  7. mozie

    Slow down champ.

    Working through the first few chapters of a book can be interesting. What happened to me, was not really paying attention to what the book was trying to teach me at that time. It was just going over opening and closing connections. The sample code did some other things, where we had to write some code. I decided to test myself, by commenting the source, to prove to myself I know what I learned. Well I was wrong. I thought it was doing something completly different than what it was really doing. So I got side tracked by trying to learn what I was doing in these places that were not the real focus. After this happened, I thought to myself "they should warn you, 'its ok to not understand this and that'". Well, the next chapter had a section that said just that. Yay.
  8. mozie

    I'll be back

    After my drive crashed, and summer time hit in.. I had no time. I took 2 vacations, one in June and one in July for the 4th. In June my and the GF went to Lakeside, Ohio. Drove there, and back. Well I rode in the back of a Suburban, in total we spent 3 full days driving. Lakeside is cool, but its a sober community. I guess that is the only way to keep it nice like it was, very peaceful. So yeah, summertime crept up on me and stole all my time. Not to mention all the money that you put into your car in the summer. Now I am poor again, and will be spending much more time in VS. Oh yeah, and other forums are boring.
  9. I finally bought an ADO.NET book, found this one at Barnes & Nobel and decided to pick it up. I have no way to rate, or review it because It's my first book on ADO.NET. With that being true, I want to say that I do like how it gets you into the creation of objects quickly. Minimal setup time for the MSDE (if you know what you are doing) is required. It gives C# and VB samples which is nice. I am mostly excited about being excited about programming again. :D I think I am like most people, who have a general idea of what a database system does, and take a wild guess about how it works. I really do like expanding my knowledge on different computer related subjects. Until next time...
  10. mozie

    Busy.

    Yeah, I have been busy playing games. I feel a bit distant from game programming right now. I think I should widen my skill set. I have done most of my programming with from-scratch source, I really need to get more comfortable working with different API styles. I am working with .NET stuff right now, just basic controlls stuff like reading values from textBoxes and such. I have been also working on a keylogger for use at work. We work with an AS/400 database, and the terminal client does not have a history. So I figure I'll see what I can do with a keylogger. They seem easy enough in form, but mine crashes the application that is in focus when the input is read. Fun stuff. A little hard to debug though. I dont have a system debugger like SoftIce, maybe I dont need one, but I set a breakpoint in the code that is within the KeyboardProc function that I wrote, and it does not break. I have set the breakpoint to several positions and none of them cause it to stop before the crash. I also want to learn about multi-threaded applications. I think I better learn that now, with multi core being the new standard in CPU development from now on.
  11. mozie

    oh teh noes!!

    I guess my MBR is ok, because I was able to get to my boot loader. I had Win2K installed on my c:, and XP-64 on d:. I see the 1st graphical promt that windows is loading for about 2 seconds, then I get an error, "inaccessable boot device". I was able to boot into XP-64 no problem, did a virus scan, and found 2 on my d: drive. They were located in the IE cache, and the 'systemvolume' folders. So thats kinda strange that they *maybe* took out by system. Only thing they happened was I just installed 3 new fans, a pair of 80mm and a 120mm. When I booted up from that, and tried to goto 2K I got the BSOD and figured my OC was not stable with the voltage, becuase I had my memory at 2.90V. I still have some ideas for trying to recover my data, but I almost just want to format it so I can just get over it. The spoon was in there prior to the incident, so I don't think that caused it. I left it where it is.
  12. mozie

    oh teh noes!!

    my C: drive is gone. virus? maybe. booohoooooo hooOOO!!!!! :(
  13. mozie

    Untitled

    User input has been added. I might have found why I was having upload problems. Still at work, so I will make this one short. Quote: Min bet: $5 Max bet: $200 Decks: 4 Saturation: 0.35% Player please give me your bet: 80 Player bets $80 ** Shuffled Deck ** Dealer: C10 H3 Points: 13 Player: S7 C10 Points: 17 Player, (H)it or (S)tand? :s Player stands. Dealer takes a card.. C10 H3 H3 Points: 16 Dealer takes a card.. C10 H3 H3 DA Points: 17 Player pushed. Player Funds: $1080 You can download it.
  14. mozie

    im writing in here

    I have alot of the little bugs worked out of the game logic code. Some new stuff was added for a computer player AI with Basic Stratigy plus a High-Low count. I was going to add input so the player wasnt always a computer player, but I didnt really try too hard. I was busy cleaning up the rules logic, it was some times paying out on player busts. I still have a some-how-broken bool that is getting a true reading, when the last function set it to false. But oh well, here is a run that went better than any have with the current build. Quote: -- Begin Round: 10593 -- Count is: 5 Player bets $20 Dealer: D7 D10 Points: 17 Player: CJ D2 Points: 12 Player takes a card: S2 Points: 14 Player takes a card: H8 Points: 22 Player busted. Player lost $20 Player Funds: $0 Game ended. High Funds: $1687.5 (Round 6124) Most runs only go 400-900 rounds, and have a high funds of about the same range. I tried to upload it, but I get this: Quote:aspSmartUpload error '800a0006' Overflow /community/forums/mod/fileman/fileman.asp, line 298 I try again, and I get a different error. So Ill just post the new stuff in source. #ifndef _TABLE_H_ #define _TABLE_H_ #include "Player.h" #include "Deck.h" #include "Hand.h" #include "Card.h" typedef struct TableRulesT { float minBet; float maxBet; unsigned int numDecks; float Saturation; } TableRules; class Table { public: Deck* TheCards; Deck* TheBoot; Player * Dealer; vector Players; TableRules Rules; Table() { Dealer = new Player(); Dealer->name = "Dealer"; TheCards = new Deck();// (52); TheBoot = new Deck(); SetRules(); TheCards->Generate(Rules.numDecks); } ~Table() { delete Dealer; delete TheCards; delete TheBoot; vector::iterator b = Players.begin(); vector::iterator e = Players.end(); for(;b != e; ++b) delete *b; } Player* AddPlayer() { Player * p; Players.push_back((p = new Player())); string pnum; string pname = "Player"; p->name = pname ; p->funds = 300; return p; } Player* GetPlayer(unsigned int i) { return Players[i - 1]; } TableRules SetRules(float minBet = 5, float maxBet = 200, unsigned int numDecks = 4, float sat = 0.35f) { Rules.minBet = minBet; Rules.maxBet = maxBet; Rules.numDecks = numDecks; Rules.Saturation = sat; return Rules; } bool BetsDown(); void Deal(); void ShowTable(); void DealerTurn(); void PlayersTurn(); void ScoreRound(); void CollectHands(); void AIBasicPlayer(Player * player); }; #endif #include "Table.h" bool Table::BetsDown() { bool AllDown = true; Player * p; vector::iterator b = Players.begin(); vector::iterator e = Players.end(); for(;b != e; ++b) { p = *b; if(p->active) { p->busted = false; if(p->computer) { // setup computers Count based bet if(TheCards->Count > 1) { cout p->funds) bet = p->funds; p->bet = bet; } else { p->bet = Rules.minBet; } } else { // input bet } if( (p->bet >= Rules.minBet) && (p->bet bet > p->funds) p->bet = p->funds; if(!p->bet) { AllDown = false; } else { p->funds -= p->bet; } } else { p->bet = 0; p->active = false; } cout name.c_str() Cards.clear(); TheCards->Shuffle(); cout Draw()); for(unsigned int i = 0;i < Players.size(); ++i) { Players->hand.Hit(TheCards->Draw()); Players->active = true; Players->busted = false; } Dealer->hand.Hit(TheCards->Draw()); for(unsigned int i = 0;i < Players.size(); ++i) { Players->hand.Hit(TheCards->Draw()); } } void Table::ShowTable() { cout RevealCards(); for(unsigned int i=0;i < Players.size(); ++i) { cout name.c_str() RevealCards(); } } void Table::DealerTurn() { while(Dealer->Points() < 17) { cout Draw()); Dealer->RevealCards(); } } void Table::PlayersTurn() { vector::iterator b = Players.begin(); vector::iterator e = Players.end(); Player * p; while(b != e) { p = *b; if(p->active) { if(p->computer) { AIBasicPlayer(p); } else { // input player } if(p->busted == true) { *TheBoot = *TheBoot + p->hand.GiveBack(); } } ++b; } } void Table::ScoreRound() { unsigned int pnts; unsigned int dpnt = Dealer->Points(); float income; vector::iterator b = Players.begin(); vector::iterator e = Players.end(); Player * p; for(;b != e; ++b) { p = *b; pnts = p->Points(); if( p->busted ) { cout name.c_str() 21) { cout name.c_str() hand.Cards.size() == 2) { income = p->bet + (p->bet * 1.5f); p->funds += income; } else { income = (p->bet * 2); p->funds += income; } cout bet) hand.GiveBack(); } *TheBoot = *TheBoot + in; } void Table::AIBasicPlayer(Player * player) { Card dupc = Dealer->hand.Cards[1]; bool thinking = true; player->busted = false; while(thinking) { /* if(TheCards->Count > 4) { thinking = false; cout name.c_str() hand.numCards == 2) { cout name.c_str() Draw()); cout name.c_str()
  15. mozie

    a journal entry

    Hmm, perhaps I was influenced by outside sources without their disgression. Whatever it was it made me take my shuffle method, and redesign it to work with operator* along side of the operator/. So now I can split the deck another time easily and clearly in the code. void Deck::Shuffle() { unsigned int sz = numCards; vector D; vector E; vector F; srand((unsigned)time(NULL)); unsigned int ra = 5 + (rand() % 3); for(unsigned int h = 0;h < ra; ++h) { *this = *this
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!