Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Everything posted by bilsa

  1. Hi! I have a problem with an application that uses a database for storing the state of different arbitary jobs to run. The issue I'm having is that if a job of a specific type is running, no other job with the same type may start, and sometimes if the application is forcibly shutdown - the state of an ongoing job might not be updated. For example: I have 3 jobs in the database, "Job1" was started but due to the application beeing forcibly shutdown, it will never complete and the status will be kept at "Running" - which will not allow the "Job3" to start, since they both have the same job type "JobType1": Job1 | JobType1 | Running Job2 | JobType2 | Finished Job3 | JobType1 | Pending I'm thinking I could add something like a "Timeout" value, which says how long a job may be running until it is treated as "Closed" and if it is already running it is terminated, thus allowing "Job3" to begin. However, I would preffer that jobs are allowed to run any amount of time, until it is actually completed. So, can someone give me input on how this can be done, or at least point me in the right direction - I'm guessing there should be some relevant concept solving this kind of synchronization issue. Basically what I want is to have a database with jobs, and multiple applications consuming the jobs. Thank you.
  2. Hi, Thanks, I was thinking along the same lines, however I was also thinking about setting up a "scheduling service" via .NET remoting, and let clients connect and request for jobs to execute. And as long as the clients are still connected, the job is still running. If a connection is lost, the client has a timeout of lets say 2 min to reconnect and inform the scheduler that it is still running, otherwise the scheduler service sets the job as timed out. Of course there is still a problem if the scheduler service would crash or fail or loose connection to the database - however, as I figure it the service would be some kind of "critical service" in this setup, and if it dies it is up to the administrator to manually restore / fix the jobs.
  3. Hi! What I would like to do is to click on a button in a java window, doing this programmatically from a c++ application - using the windows API, SendMessage / PostMessage. I have managed to send a "mouse left button click" to the window. This works, when I keep the mouse over the button that I want to click. But if I don't hold the mouse over that button it doesn't klick it, instead it clicks wherever I hold the mouse. So it seems that the WM_LEFTBUTTONDOWN / WM_LEFTBUTTONUP does indeed work, but the lParam (coordinates for the click) are not used, but instead they are fetched some other way. I have also tried sending WM_MOUSEMOVE before the WM_LEFTBUTTONDOWN, in order to move the mouse to that position before clicking it. But that one doesn't seem to do any good. Does anyone have some experience with sending win32 "messages" via the SendMessage / PostMessage methods to a Java window? Would really appreciate some thoughts on this. Thank you
  4. Hi, thanks for the help, but I don't want to be that specific, that I need to know that it's a button, I might for example want to click on some other control. I mean, it should be possible to emulate the clicks in a generic way, I do have the handle of the main window.
  5. Hi, I didn't know where to put this question, but here I go: I have come to a "design" with 3 webservices which in turn are dependant on eachother, but not as static references but dynamic, like this: IService1 { void DoSomething(string sIService2Url) {...} } IService2 { //This is usually called by IService1 void DoSomethingElse() {...} void DoSomething(string sIService3Url) {...} } IService3 { ... } Do you get what I mean? IService1 is dependant on receiving a valid url to IService2, the actual interface contract for IService2 is agreed on between the two services. Would you say that this kind of service contracts should be avoided? The option we have is to merge the the services into one, which I would say is feasible for IService2 and IService3, but not really for IService1 and IService2. Generally, I've never had to design webservices like this - I would just reference the required IService2 implementation as a webservice reference in the IService1, but the issue is that we would need to provide different implementations of this, chosen by the client. Doe anyone know what this "concept" would be called - so that I can read more about it? Thank you.
  6. Hi, WCF also has support for "Duplex Bindings", which makes it possible for WCF to call methods on the Client - the client provides the WCF service with an interface. (That is if your are going to look into modifying the service...)
  7. Hi there! I somewhat recall there was an old thread started by Yann - the graphics guru :P - where he described his shader system along with a batching system for geometry. If I'm not entirely mistaken the batching was sorted using some modified version of Radix sort to minimize state changes during the rendering of a frame. Then there was the use of geometry slots pointing to a vertexbuffer. As I understood this each geometry had it's place in a large vertexbuffer shared by many different geometrys. This was to reduce the change of vertexbuffer states. What I'm wondering is if there really is any big performance gain nowadays in batching multiple objects into one batch, when speaking of models consisting of lets say 5000~10000 triangles? And something I didn't really get is how such catching would be implemented most efficiently, as I see it the most optimal way would be to fill a vertexbuffer with spatially local geometry that will most likely be rendered together. For static geometry that never move in a map it could be somewhat achieved... Anyway, is there really any point in wasting much effort and time into caching into large vertexbuffers?
  8. bilsa

    Geometry batching?

    Yeh, that slot memory setup is interesting. I'm thinking I could live with some memory waste in the slots. (anyway it sounds cool "having written a gpu memory slot system" :P) Ok, big thanks to everyone ;)
  9. bilsa

    Geometry batching?

    Ok, good to hear. I already started on implementing the sorting mechanism/state tree anyways :) Another thing I was thinking about was how to best manage the vertexbuffers. For static that won't be moving I figure it would be best to store the data depending on spatial positioning. Since spatially close objects probabilly will be rendered simultaneously anyway. Then after dividing the vertexbuffers to spatial areas, also try to sort vertices of the same type close to eachother in the vertexbuffers. So, basically I was thinking to have something like this: World Map: -------------------------------| | | | | | | | VB1 | VB2 | | | | |______________|_______________| | | | | | | | VB3 | VB4 | | | | | | | |------------------------------| Now assuming that each vertexbuffer has some "optimal" size. Then also put the data that has same vertex structure close to eachother in the buffers. Do you think this will affect performance much at all? VladR, so you used only one large vertex buffer? did you sort the vertex data according to the vertex structures in that buffer? (btw, I know that I whouldn't worry about this now... yada yada... despite I want to do this)
  10. bilsa

    Geometry batching?

    Yeh, I would think so too. Does anyone know if the size matters? or is it that performance is worse when getting over some size?
  11. Hey, does anyone know if there is a way to make an opengl application with c# and make it useable as an applet in IE? (Something similar to java applets.) Peace out!
  12. Hi again, I have stumbled upon an issue iäve never really thought much about. I'm having a class structure like this: class A implements Comparable<A> { } class C extends A implements Comparable<C> { } Which apparently is not allowed :( Currently I need to use the old non generic Comparable interface, which forces me to use the "instanceof" operator. Is there any other sollution to my problem?
  13. Oh dang, that 64mb memory could indeed be a problem for some serious game. Thx for the great info!
  14. Hey! I was wondering if anyone could tell me if there is any big performance difference between running the opengl application as an applet or as a new window? Is it serious enough to make some quake2 clone run smooth? Thx! [Edited by - bilsa on March 2, 2007 11:48:59 AM]
  15. bilsa

    Game Programmer Resume Tips/Suggestions

    Hey, I just skimmed the last part of the resume, and I would say that look over the grammar structure of the text. To me it felt like there was too much "I did this, I did that, My this, My that" if you get what I mean. Maybe change some of the I/My to have the sentences start in varying structure, that will make it more pleasant and interesting to read :) Other than that, I don't think I'm qualified enough to comment on anything else :P
  16. Hey there everyone! I'm making a server for a mmorpg, and I'm wondering how to keep the rpg rules, such as classes and races and the class specific modyfiers etc... Should I put all that stuff into the mysql database, or do you think it's more convenient to keep it in separate script files? I find a script file for a race would be very convenient: <Race> <ReqStats> <Strength = 15> <Intelligence = 5> ... </ReqStats> <AggroVsRace> <Elf = true> <Human = true> </AggroVsRace> </Race> Now defining this info in a database is also possible, but I find it would much less convenient :( So, maybe keep rule scripts in separate script files and keep only the actual character info in the database right? Thank you!
  17. Yeh, exactly penance... that is exactly what I was thinking! But then after reading the replies I got, I thought I was supposed to put everything in the database, except for scripts :S So basically I put all INSTANCE data in the database, for example when a player gets hit - update hp - when a new item is created - create an item instance - when someone levels up - update their lvl data, etc... And as about the rules you are telling me to keep in hardcoded functions, I was thinking to keep the simplier of the rules in LUA scripts, for example the combat script could be: function OnPlayerTriesHitMonster(player, monster) if(player.hit_probability > monster.defense) OnDealDamage(player, monster) end That was just an example, to let the administrator of the server easily change some game mechanics like that, especially the damage dealing functions would be of value and the AI functions... Does that sound better?
  18. Ok, guys... so I went with a "complete database sollution" where I keep everything in the database, for example: ------------------------------------- TABLE: GameRuleSets ------------------- RuleSetID Description AvatarCreationRuleID TABLE: AvatarCreationRules -------------------------- AvatarCreationRuleID MinAvatarNameLength MaxAvatarNameLength ... TABLE: NPCTemplates ----------- NpcTemplateID Name Race Class HP ... ------------------------------------- Now I have come to the point where I added scripts for defining specific game rule logic and AI scripts, and I'm thinking if I didn't make a misstake and should have gone completely with the scripts approach instead of Databases for storing static game data... For example, I'm using LUA for scripts, for example a NPC script: -------------------------------------------------- MyCoolNPC --------- [This part could be optional instead of having it stored in the database] Name = "MyCoolName" Race = MyRace Class = MyClass [/end of optional data] function OnAttack(attacker) ... end function OnSpeakTo(player) ... end -------------------------------------------------- You see where I'm going with this, why should I store the static game data into a Database, when I in fact probabilly will want to have scripts for the characters anyway, so wouldn't it be more practical to store the static data in the scripts as well? And then I would only store "Instance" data in the database, that means I would only store data about objects that are "alive"/existing in the world in the database. Hope someone can clarify this for me, why should I use a database for that kind of data??
  19. Ok, thank you everyone! I think I'll put everything in the database :P seems like very convenient for backups... Most of this data is static, so it will only be loaded once during server startup, then character status data will be updated frequently during specific actions in game, but mostly will be kept in server memory. Laters!
  20. Yeh, but I find it very tedious to have all the races and classes defined in the database... for example. <class name="fighter"> <min_stats> <stat strength="12"> <stat dexterity="12"> </min_stat> </class> <class name="mage"> <min_stats> <stat intelligence="12"> </min_stat> </class> Now, see... I can define the different stat requirements as it goes, and it's very easy to differ the number of requirements etc... Now if I go with a database, I would prolly need to have a single template which ALL classes need to define... no matter if the class really has a minimum stat on intelligence or strength, right? Hope you understand what I mean...
  21. Hi everyone! Ok, so I have come to the stage of deciding how to handle the database structure/implementation on the server part. I have decided to use a mysql database. So, what I'm wondering is more of how to use the database. Should I load the entire databases during startup, or should I query them during runtime ? For, example: If I have a database with player accounts, should I load this database into memory for faster lookup or should I query the accounts by username directly from the database? (or is the database query performance close to identical anyway?) Or for example the player satus. Should I store the player status, such as HP/MP/inventory items in memory and write to the database only during disconnection or a crash? Or should I query the database every time the status is affected? (I'm thinking that as long as I really make sure that a client never can disconnect in a manner that the write to the database isn't performed... then I should be ok?, and of course during a server crash really make sure that the status will be stored to the database anyway...) Would appreciate some thoughts on this?
  22. bilsa

    Databases in mmorpg?

    Hey everyone, thank you for the excellent replys! I think I now have enough meat to figure out the rest ;) I really liked the idea of introducing a state machine for different player states :) as with my current design I have found myself checking for prevoious states like: void LoginRequestHandler(...) { if(successfull login) playerStates.IsLoggedIn = true; //... } Then later in character screen I would have to: void SelectCharacterHandler(...) { if(playerStates.IsLoggedIn) //char selection ok... } Would be much cleaner if I could just define a statemachine for a login sequence when a player connects :) new StateSequence(new LoginRequest(), new CharSelection(), ...); Nice :O Thanks again everyone!
  23. bilsa

    Databases in mmorpg?

    Thx guys! Ashaman, it's exactly the decoupling of db writes I'm worried about. The thing is that I'm not going for one thread/client. So for example, if a client sends me a request that needs database interaction: The request will be placed in the request handlers queue. And once the request handler starts handling this request, then all other requests will have to wait until it's finished. So if the database access take like 200ms, that is very bad :( So, I was thinking to maybe use a similar approach to .Net async apis, having a BeginGetAccount("username", OnAccountRetrieved). How do you think that would work out? Alternatively, I was thinking just spawning another thread for those requests that need databaseinteraction? Thx!
  24. Hi there! Currently I have created an async server with .Net. My question is not so much about the networking but about how many threads should be optimal usage? Currently Im using threads in the following cases: 1. The .Net thread pool is used for asynchronous read/write/connect/disconnect network data transfers. This thread pool may use up to 25 threads. 2. An cusom threadpool for generating events in the server. This thread pool uses 5 threads for generating events in the server such as OnPacketRecieved(...), OnClientConnected(...) etc... My thinking behind this wast that the networking code should not be interrupted by firing an event. 3. The actual server handling instance, recieves events from the server. The handling of events does not take much time. Most time is consumed by OnPacketRecieved()/OnPacketSent() event handling. In this case the packets are translated into a Request and put into a PriorityQueue. 4. A RequestHandler uses 10 wokrer threads to process the requests in the priority queue. Ok, so that makes about a total of up to 40 threads. In a game, I would say that is way to many threads... I was wondering if I'm overexaggerating the thread usage? Am I completely off the design? Would appreciate any tips, and suggestions.
  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!