• Content count

  • Joined

  • Last visited

Community Reputation

421 Neutral

About Lewa

  • Rank

Personal Information

  • Interests
  1. That is EXACTLY what i needed/what i was looking for. Thank you! Although i'm having a hard time understanding why this formula works. (As i seem to misunderstand how the viewspace works.) What exactly do you mean with "parallel"? If they are axis aligned in view space?
  2. I nearly got it working. But there still seems to be a minor error in the calculation of the mirrored depth value. Here is the current fragment shader (vertex shader is the same as above:) #version 330 in vec4 oColor; in vec2 vTexcoord; out vec4 outputF; in vec4 gl_FragCoord; uniform sampler2D sGeometryDepth; in vec4 gl_FragCoord; in vec4 vFragWorldPos; in vec4 vOriginWorldPos; in mat4 vProjectionMatrix; float linearizeDepth(float depthVal,float zNear,float zFar) { float n = zNear; // camera z near float f = zFar; // camera z far float z = depthVal; return (2.0 * n) / (f + n - z * (f - n)); } void main() { float uZnear = 0.01; float uZfar = 500.0; //get texture coordinates of the screenspace depthbuffer vec2 relativeTexCoord = vec2(gl_FragCoord.x,gl_FragCoord.y); relativeTexCoord = relativeTexCoord-0.5+1.0; relativeTexCoord.x = relativeTexCoord.x/1280.0; relativeTexCoord.y = relativeTexCoord.y/720.0; //depth of the backfacing sphere pixels and of the level geometry (depth texture of different FBO) float backDepth = linearizeDepth(gl_FragCoord.z,uZnear,uZfar);//back depth float geometryDepth = linearizeDepth(texture2D(sGeometryDepth,relativeTexCoord).r,uZnear,uZfar);//geometry depth //Now we have to calculate the front depth //--------------- Calculation of front depth--------------- //get distance from origin to the fragment (in viewspace) float depthDiff = (vFragWorldPos.z-vOriginWorldPos.z); //substract depth difference from origin point in order to get the mirrored coordinate point of the sphere vec4 sphereMirrorPos = vec4(vFragWorldPos.xy,vOriginWorldPos.z - depthDiff,vOriginWorldPos.w); //apply perspective calculation vec4 projectedMirrorPos = vProjectionMatrix * sphereMirrorPos; projectedMirrorPos/=projectedMirrorPos.w; //depth calculation float frontDepth = (projectedMirrorPos.z + 1.0) / 2.0; frontDepth = linearizeDepth(frontDepth,uZnear,uZfar); //want to color only the pixels where the scene depth (provided by a screen space texture which is a depthbuffer of a different FBO) //is exactly in between the min/max depth values of the sphere if(backDepth>geometryDepth && frontDepth<geometryDepth){ outputF = vec4(1.0,1.0,1.0,1.0); }else{ discard; } } I believe the issue is somewhere here: float depthDiff = (vFragWorldPos.z-vOriginWorldPos.z); //add normal to origin point in order to get the mirrored coordinate point of the sphere vec4 sphereMirrorPos = vec4(vFragWorldPos.xy,vOriginWorldPos.z - depthDiff,vOriginWorldPos.w); "vFragWorldPos" is the position of the current vertex in ModelviewSpace. "vOriginWorldPos" is the origin of the sphere in modelviewSpace. I simply calculate the z difference of both points by substracting the z components of both vectors. Then i reconstruct the mirrored vertex coordinate by using the xy coordiantes of "vFragWorldPos" while the z-coordinate is calculated by substracting the depthDifference from the origin z-coordinate. The issue is that it doesn't seem to give correct results by doing so. I tested if this reconstruction method by changing this line: vec4 sphereMirrorPos = vec4(vFragWorldPos.xy,vOriginWorldPos.z - depthDiff,vOriginWorldPos.w); to this: vec4 sphereMirrorPos = vec4(vFragWorldPos.xy,vOriginWorldPos.z + depthDiff,vOriginWorldPos.w); which effectively calculates the depth of the back side of the sphere which i then compared with the values of the depth buffer. They are exactly the same. (which is correct.) But substracting the depthDiff value doesn't yield correct results. Is there something that i'm missing? Maybe the z coordinates of the vertices which were transformed to modelview space aren't linear?
  3. Currently sitting on an issue which i can't solve due to my lack of mathematical knowledge. Here is a picture i made which sums up what i'm trying to do: To put it simply: I render spheres (simple 3D meshes) into the scene on a seperate FBO by using frontface culling (so that the backside is rendered. The red part of the sphere on the screenshot.) Now, in the fragment shader i can access the depth value of the rendered pixel by using "gl_Fragcoord.z". Now what i want to do is to calculate the depth value of the front facing side of the sphere of the exact same pixel. (so that i have a min and max depth value in order to know what the start depth and end depth value of the sphere on the given pixel is.) I need those values for post processing purposes. My attempt to solve this was: pass the current vertex position into the fragment shader subtract the vertex position from the origin point (in view space) to retrieve a normal pointing from the origin to the backface point Mirror the z-component of this normal (as we are in view space) add the mirrored normal to the origin point which gives us the front facing (vertex) position of the sphere use this position to calculate the depth value like in an openGL depth buffer. (haven't done this properly.) I may or may not have an error in my shader code. (Maybe the way i multiply matrices is wrong?) Here is my current code (a bit messy but i tried to comment it.) //-------------- Vertex Shader -------------------- #version 330 layout (location = 0) in vec3 position; layout (location = 1) in vec3 normal; layout (location = 2) in vec4 color; layout (location = 3) in vec2 uv; uniform mat4 uProjectionMatrix; uniform mat4 uModelViewMatrix; out vec4 oColor; out vec2 vTexcoord; out vec4 vFragWorldPos; out vec4 vOriginWorldPos; out mat4 vProjectionMatrix; void main() { oColor = color; vTexcoord = uv; //coordinates are in view space! vec4 tFragWorldPos = (uModelViewMatrix * vec4(position,1.0)); vec4 tOriginWorldPos = (uModelViewMatrix * vec4(0.0,0.0,0.0,1.0)); vFragWorldPos = (uModelViewMatrix * vec4(position,1.0)); vOriginWorldPos = (uModelViewMatrix * vec4(0.0,0.0,0.0,1.0)); gl_Position = uProjectionMatrix * uModelViewMatrix * vec4(position,1.0); //send projection matrix to the fragment shader vProjectionMatrix = uProjectionMatrix; } //---------------- Fragment Shader -------------- #version 330 in vec4 oColor; in vec2 vTexcoord; out vec4 outputF; in vec4 gl_FragCoord; uniform sampler2D sGeometryDepth; in vec4 gl_FragCoord; in vec4 vFragWorldPos; in vec4 vOriginWorldPos; in mat4 vProjectionMatrix; void main() { //get texture coordinates of the screenspace depthbuffer vec2 relativeTexCoord = vec2(gl_FragCoord.x,gl_FragCoord.y); relativeTexCoord = relativeTexCoord-0.5+1.0; relativeTexCoord.x = relativeTexCoord.x/1280.0; relativeTexCoord.y = relativeTexCoord.y/720.0; //depth float backDepth = gl_FragCoord.z;//back depth float geometryDepth = texture2D(sGeometryDepth,relativeTexCoord).r;//geometry depth //--------------- Calculation of front depth--------------- //get distance from origin to the fragment (normal in viewspace) vec3 offsetNormal = (vFragWorldPos/vFragWorldPos.w).xyz-(vOriginWorldPos/vOriginWorldPos.w).xyz; //mirror depth normal (z) offsetNormal.z*=-1.0; //add normal to origin point in order to get the mirrored coordinate point of the sphere vec4 sphereMirrorPos = vOriginWorldPos; sphereMirrorPos.xyz += offsetNormal.xyz; //apply perspective calculation vec4 projectedMirrorPos = vProjectionMatrix * sphereMirrorPos; projectedMirrorPos/=projectedMirrorPos.w; //TODO: CALCULATE PROPERLY float frontDepth = projectedMirrorPos.z * 0.5 + 0.5; // no idea what do do here further //want to color only the pixels where the scene depth (provided by a screen space texture which is a depthbuffer of a different FBO) //is exactly in between the min/max depth values of the sphere if(backDepth>geometryDepth && frontDepth<geometryDepth){ outputF = vec4(1.0,1.0,1.0,1.0); }else{ discard; } } I suspect that maybe transforming the coordinates into viewspace in the vertex shader (and working with those coordinates) may be an issue. (No idea where/when to divide by "W" for example.) Also i'm currently stuck at the part where i have to calculate the depth values in the same range as the OpenGL depth buffer in order to compare them in the if statement shown at the end of the fragment shader. Hints/help would be greatly appreciated.
  4. Glad to hear that this solution isn't that uncommon. :)   That's a lot. o.O I'm curios now: what are the "common" tickrates used for games? (I know that this will depend heavily on the genre and gametype and has to be determined individually for each game.) Given that the this approach requires the CPU to be fast enough in order to process X amount of ticks per second (otherwise we would have a CPU bottleneck and the game would slow down) you need to make sure that every operation (physics, collission detection, AI, etc...) can be crammed into 1/600 of a second in order to run properly (at the desired speed), am i right? (Such a high tickrate wouldn't cope well with open world games which have way to much random variables influencing the load on the CPU?)
  5. So is this a common thing in todays games? Running the simulation at 100+ ticks on the CPU and interpolating between the old- and current gamestate for smooth unlocked rendering? What about the introduced latency? (by being always one frame behind?)   Trackmanias implementation interested me as they have the same requirements as i do (consistency in the physics) but they manage to unlock the rendering framerate as well. (I suppose without introducing latency?) I wasn't able to find anything about their implementation on the internet though.   I have the same requirements. > Consistency in the physics but i would also like to have an unlocked framerate (without introducing additional latency due to the interpolation technique.)
  6. I realise that this is one of those questions that gets asked multiple times a day, but after extensive research i wasn't able to answer one specific question (which i will get to.) (And yes, i've also read the "Fix Your Timestep" article.) So what i wanted to implement was a fixed update tickrate (like 60FPS) with the ability to unlock the rendering framerate to render the game as fast (and as smooth as possible.) The "easiest" approach would be to use a variable timestep (delta time) but i don't want to do that. Mainly due to consistency of the game physics/behaviour across multiple playthroughs.   So from what i was able to gather, there are two ways in implementing a gameloop with a fixed tickrate and an unlocked (variable) framerate: > Interpolation and Extrapolation. Extrapolation is basically a "prediction" of the gamestate in the next frame (which wasn't calculated yet on the CPU side.) So you do something like position + velocity * interpolationvalue during rendering. This may work, the issue is that the extrapolation can have wrong results (objects passing through geometry for a short timespan) before the position is corrected. Also movement which is non-linear like rotation, acceleration, etc... would also have wrong results.   The other things is interpolation. I like the idea of the approach. We take the last frame and the current frame and interpolate between them while the next game update is being processed resulting in smooth motion and it allows us to render the game at a higher framerate. Now the caveat here is latency. Because you interpolate between the last frame and the current frame, your game state is (visually) always 1 frame behind. This essentially increases the latency/responsiveness of the game. (At 30 fps its 33.33ms, at 60 FPS its 16.66ms) In my opinion this depends entirely on the gametype if this latency is acceptable or not. RPGs might get away with it, but fast paced games with emphasis on fast/reactive gameplay can suffer. And given that i'm working on a game which emphasizes fast/reaction based gameplay, this is an issue which i want to circumvent. (Currently i update at a fixed rate of 60 FPS.)   So my question is: How do games with the requirement of consistent physics/behaviour implement their gameloop while retaining the ability to render at an unlocked framerate? Competetive games come to my mind. But especially the Trackmania Series. AFAIK Trackmania has consistent physics (Otherwise all those "press forward and let the car magically drive through the whole track" maps wouldn't be possible) . But it's also able to render at an unlocked framerate.  Here is a video where someone did a benchmark and was able to run the game at 200-400 FPS: [media]https://www.youtube.com/watch?v=Jk_N09Z4YXE[/media] My question is: How is that possible? Trackmania is a fast paced racer which needs low-latency input (I can't imagine that they are sacrificing substantial latency for framerate independence). Are they using interpolation at all? How is their gameloop implemented?   The only solution i'm able to come up with with regards to interpolation is making the game update at a very high (fixed) rate (like 200 ticks per second.) in order to reduce the latency as much as possible.
  7. I get the feeling that Austria is (in general) very unfriendly for small businesses/sole-proprietors due to the mandatory insurance. (No one who only earns 5-6K in a year will be able to pay 2.5K or more for insurance and live from that effectively.) It sounds somewhat funny that you can be executed by the local "self-employment/business" social insurance ... (which is seperate from the social insurance which normal employed people get.) Oh well...      It may be a possibility, but i would like to avoid any kind of legal trouble by doing so. Not to mention the language barrier and the lack of knowledge about the specific laws.   Although a possibility which i'll look into is the LLC in poland. (I'm polish after all and i'm visiting my grandmother/family in poland anyway on every vacation.)     I informed myself a bit about the polish LLC last night. There is a yearly cost that you have to consider. 1) around 440 Z?otych to pay to the KRS (some form of yearly documentation of the LLC) per year (is around 110 euros) 2) monthly payment of around 300-500 Z?otych (around 75-125 euros, can be even higher) to pay for "bookkeeping services" LLCs in poland have to do "full bookkeeping" (at least that's how it's called here. Sole-proprietors/Self-employers don't need to do that.). From what i've heard/read you can do it yourself (which would save you the monthly payment) but it's strongly recommended to pay an accountant/bookkeeper to do it for you. (As it seems to be rather complex?)   But i'll inform myself further on this and search an accountant. (Before i start to post more uninformed/false information. :P )     Still, i'm open for more input/insight as to how that stuff looks like/works in other countries. (To get an idea if such costs are the norm or if i happen to live in a country which is rather "business-unfriendly" for small companies)
  8.   And there is no additional cost involved (up to the 18k limit) which might eat away your income? (Like the said social insurance or any other stuff like that which you "have" to pay yearly and/or is mandatory.)   A friend of mine who already sells a game on steam faced the problem that his income was going above the 5k limit. In order to avoid the mandatory insurance (which would cut his income in half and would generate costs over the next years) he had to generate cost in order to stay below that level. (he even stopped advertising/talking about the game on his blog/twitter/youtube and reduced the price of the game on steam...)       At first, i was also considering an LLC as an option. (Especially because of the legal insulation which you have mentioned.) But it turns out that it's even more costly/complicated to create said company here. As an example, in Austria you need to have a at least a capital stock of 35k€ in order to start a GMBH (which is the austrian/german equivalent of an LLC.)   The other option would be to open an LLC in poland. The requirements in poland are far less restrictive (You can start an LLC with a capital stock of just 5000 Z?otych which is around 1200 euros.) But you still have ongoing costs of running an LLC (in addition to paying the insurance in Poland, which is around 3000 euros in a year) and it's (as far as i know from reading on the internet) harder to manage compared to a sole proprietorship. (But i'll look into that further.)       Well, i probably should. Although, i'm not sure if i'll be able to avoid the insurance costs. (It's mandatory for everyone, even if you have a job and doing indie-dev as a part-time job.) (Best part is that if you work full time and do part-time self employment, you pay insurance twice. Once as self-employment and a second time from the full-time job...)   I don't want to dive into gamedev full-time (still studying). Just wanting to tap my toe into the water to gain some experience and see how well indie dev would work out for me.
  9. I don't know what i should put into the title of this topic.   There is always one thing that i always wondered: How do people release their (first) indie game without falling into a potential spiral of cost and or (high) taxes?   Before i go further into details, let me explain my situation.   I'm a 24 year old student studying/living in Austria (not Australia  :P ) but my nationality is polish. I'm just making finishing touches on my hobby game project which i planned to release commercially on steam (i already passed the Steam Greenlight process successfully.)   Now, in Austria i need to register as a Sole-Proprietorship in order to be able to distribute the game through steam. - no problem here. AFAIK taxes only need to be payed if you have a revenue of over 11.000 euros in a year. (very simplified.)   The bigger issue here is the cost of the (mandatory) Social insurance. Now, you don't need to pay social insurance if you have a yearly income of max 5.000€ and a max turnover of 30.000€.   If you go above that restriction once in a year, you have to pay the yearly social insurance for (at least) the next 5 years (without exceptions). The cost of social insurance starts at 2.500€ (yearly) and can go even higher, depending on your income from the last 3 years. (Which is mind-bogling). As an example, if you have 6000€ income (already taxed) in a year, you will have to pay nearly 41% from your income for social insurance alone. (You aren't even able to live from that in this country.)   And to be honest, this seems to be very restricting. Basically if i start selling a game on steam, my income from the sales can't go above 5.000€ (unless i start to create costs in order to write them off from my income. Which i might have to do in the end...)   Now, given that i never released anything commercially (means that i have no idea how much i can expect to make in the first year) and because i'm studying and doing this mostly in my spare time (means that i don't know how long it would take to release another game... the current project took nearly 4 years to make) i'm a bit paranoid. I don't see how running a company as a Sole-Proprietorship is/would be financially viable once i would hit the given yearly limit of 5000€ (income). (Because after that i would need to pay a minimum of 2500€ yearly for social insurance, even if i don't have any income at all.)     (Obviously games sell at release date in the first month (or months) the most which means that the revenue in the first year might be high and then fall off to nearly 0 in the following years (Austrian law is/was made for self-employed people and companys which have a steady income over the months.) )       What i'm interested in is (if you live in another country) how the law (in your given country) handles Sole-Proprietorships/Self-employment. Do you have (mandatory) insurance? How much can your income be without paying taxes (or insurance?) Are there any kind of other "hidden costs"  which you have to keep in mind?     After gathering the information (reading austrian law, calling the local Austrian Federal Economic Chamber, etc... ) i'm really scared with the attempt to register as a Sole-Proprietorship. (And thus even considering releasing that game for free.)   Because let's face it: I'm in no way able to have a steady and high enough income to pay the insurance. (Not as an hobby-indie dev who released only one game and sure as hell not with a game which no one has ever heard about.) Of course, all that stuff wouldn't affect me if the game sales very poorly on steam (which very well might be the case. Who knows. I just want to make sure to not fall into a financial trap.) And logically, as a student who wants to release a game (primarely as a hobby) and might not release another one for the next 2-4 years (if at all), i shouldn't care about social insurance at this point in time. (and pay for that yearly.)   How are other devs handling this? (Releasing games commercially as a hobby.)   Again, i might be overthinking all that stuff and i could be making assumptions which are completely off. I just wanted to ask here if someone can give some insight in how that stuff works in other countries. (It they also have those seemingly high/costly barriers.)     NOTE: I don't want any kind of legal advice for this specific problem (that's what local lawyers are for.) I'm just interested if your local law for self-employment is similar/comparable to what i explained above.
  10. I tried to come up with a "worst-case" scenario. Though, i might overestimate this number. (Again, no experience. Never released a commercial game so i can't even roughly estimate how many active players there would be.)   Question: There are for sure mobile and PC games which host their own leaderboards/stats on seperate servers. Are all of them always using dedicated machines or is there a scenario where a v-server (or virtual webserver) would suffice?
  11. Just as a reminder (as it seems that some of you think that i want to host a server which runs game logic.) I don't need to run a true "game" server which handles the game simulation.   What i'm talking about is basically a HTTP leaderboard server with a few extras thrown in. (Like statistic calculations via cronjobs, hosting of custom player content (small 32KB map files), etc...) The clients don't have an "active" socket connection to the server. They only send HTTP requests if they have to. Other than that, the game client doesn't depend on the server at all. This server would also be used to run the website as well as a forum (and maybe a blog).    The question is how beefy such a server has to be in order to be able to cope with (lets say) 1000-3000 clients (is this even realistic for an indie game to have that many clients online at the same time? XD) which during their playtime send HTTP requests to either update their leaderboard score and/or retrieve the current leaderboard of the game. (In the original post i roughly explained all the stuff the server has to handle.)       Well, the question how much power such a server would need for a worst-case scenario. I have no experience how CPU speed/core count and the amount of RAM would impact a server.       Exactly. The server exposes a few PHP scripts which act as some sort of API for the game which then can be accessed by sending HTTP request from the client to the server. I just don't know how demanding this stuff can be if 1000 concurrent game clients send HTTP request to the leaderboard every time they want to retrieve or update the leaderboard.   How much RAM or CPU power is needed? Is this too much for a "simple" webserver (like the one from hosteurope which i linked in the first post?)  I simply lack the experience in the production enviroment of webdevelopment in order to estimate the hardware requirements of any serversoftware. That's why i'm asking you guys. (Maybe some of you hosted a leaderboardserver with a forum and a website on a single server? If so, how well did it run on the particular hardware you were using? How many players was it able to handle, etc...)   As to the server development: I can write PHP code and gained some experience in that field. (School and hobby projects. Never worked for a company though. I'm still a student. :) ) So the software isn't really a big deal. (Most of the stuff already works. I'm just not sure if running this stuff will be viable in a production enviroment.) However, i have absolutely no experience in Linux and less so in working/maintaining a Linux server. But i would be able to work with some form of webhosting solution which simply gives me a capable HTTP server and FTP access.       Well, the issue is that i have zero experience in working with linux server administration. And after a bit of research i came to the conclusion that managing such a server is way too much hassle for me. (Updates, maintenance, security,etc...) Though, what do you mean with "small to medium sized game"? The 5$ server has just 1 vcore and 512MB ram. What exactly is that able to handle?   Second that, although I wouldn't say IOPS is the problem. Jitter is, in my opinion. Absolutely unpredictable scheduling jitter. Works perfectly well 95% of the time as if you had a dedicated server. The difference is not in any way noticeable if you run e.g. a webserver. On the other hand, it totally sucks ass for anything "game" or "game related". Here is the thing: I'm not running any game simulation on the server. So jitter isn't really a concern for me. The game sends HTTP requests to the apache webserver if nessecary to update the highscore or retrieve some other information. (Like player statistics, leaderboards, etc...) As i said, the whole server would be able to run entirely on a plain simple HTTP server, as long as it is capable enough to keep up with the amount of HTTP requests (Including Database reads/writes). (The question is how capable the server has to be.)   I was looking at hosteurope as i have heard quite a lot of good things on the internet about them. (Support, etc...) And they have a lot of different services to offer. (webhosting, webserver, webserver dedicated, V-server, dedicated server, etc...) But you are right. They are in some cases more expensive to other companys. I'm open for alternatives though.
  12. A dedicated server would be the best solution performance wise, but it is (for me at least) waaaay to costly. (I'm searching for a managed solution that would cost me around 20 euros per month. 30 euros is the maximum i'm willing to pay. Anything above that is way to risky when it comes to finances. Though i realise that this might not be possible in this price range. That's why i ask here for advice.)   When it comes to I/O performance: Is it really that bad on a virtual server? Latency is not the primary priority (i'm not running a game simulation on the server after all.), as long as the HTTP requests are processed in an acceptable timespan it should be ok. (Having a server with a SSD should also mitigate this issue somewhat. The company i mentioned above does allow you to have up to 2 MySQL databases on an SSD which would increase the SQL performance immensely.)   The primary concern for me is that the server hardware (RAM,CPU, I/O performance, etc...) on a low cost (managed/web-) server would be too underpowered to handle that load. (I don't want to find out after the games release that the server is way too underpowered and would require a significant upgrade in order to run properly performance wise. (The server provider might also step in and say that i'm overloading their server.) This would eat into my budget and would in a worst case scenario force me to shut down the servers altogether as they wouldn't be financially viable in a long term scenario. Not really great if the game is sold commercially.)
  13. Another one of my questions regarding server hosting (hope i don't annoy anyone here. :P)   To give you a bit of insight before i ask the question: I'm currently working on a platformer/racing game.   The idea is that players can race on maps and win medals (depending on how fast their run was). Custom maps can be created to by using the built-in map editor. Now, naturally to get the most out of the experience i wanted to create a master-server which includes features like: online leaderboards statistic calculations (ladderpoints, current medal count, etc... NOTE: I don't run game-simulation on the server.)  custom map sharing (players can log into the website and upload their custom maps which in turn allows others to download those from the web) 3D realtime WebGL based previews of said maps (you can preview maps in realtime in the webbrowser before downloading them server list for hosted game-servers by the players. (Hosted servers by the community register themselves on the master server so that others can see this particular server in the serverlist.)   The server could simultaneously be used to host other stuff like a forum and/or a blog for the game.     Now the big issue is that i have absolutely no idea how demanding this stuff will be in terms of hardware requirements and/or bandwidth (and traffic). Im quite limited when it comes to the budget which i can invest into the server per month. (It may be my first ever commercial release.) I know that the general answer to stuff like this is "benchmark it!". But i hope that some of you with experience on this topic can give me advice/some tips to get an general idea on how beefy a server has to be in order to handle such a load.   Here are some details about how the communication between the client and server works and how some of the mentioned features were implemented on the serverside:   Thew whole server-client communication is done via HTTP requests. Leaderboard requests are simple HTTP requests to a PHP script which reads the top 10 entries of a particular leaderboard + the players individual position. (around 2 to max 3 select statements to the database.). After each race, the client sends data (like palyerID, score, + some minor metadata) to the server and retrieves the leaderboard after the requests. (so those are 2 HTTP requests after each run.) Depending on the players skill, each map can be finished in a timespan of between 30 seconds and 2-3 minutes. (this is the average interval in which those requests could happen.) Statistics are calculated by using Cronjobs which run in an interval of 1-2 minutes on the server. In order to avoid heavy calculations, i update only 20-50 players per interval (want to save on CPU performance as the calculations can be quite heavy.). Mapfiles which can be uploaded to the server are rather small. Average size is between 32kb and 64kb (for middle to larger maps). In order to save space i compress those files on the serverside with gzip to reduce the filesize. (I also parse them on the serverside to make sure that this file really is a valid gamemap file.) The 3D WebGL based preview in the webbrowser downloads the selected map from the server as a compressed gzip file (to save traffic), extracts it on the clientside with javascript and then parses the file. Server list would also be updated with plain HTTP requests. A community hosted server could (as an example) send a "i'm still alive and have the IP XXX" HTTP request to the server every 1-3 minutes and insert/update this information in a mysql table. (Although i'm not sure if that would be feasible/a good idea for the server performance.)    Another thing that is worrying for me is running an unmanaged VPS. I've done quite a bit of research on this topic and came to the conclusion that i have no idea how to setup,secure and maintain an unmanaged server. (I don't have the time and knowledge to do that.) So i was looking into a managed server solution, though those are less common and more expensive compared to unmanaged solutions.     Now the question is, given that the communication is done by simple HTTP requests, i could technically use a simple managed Webserver/Webhosting solution (instead of an unmanaged VPS) so that i don't have to worry about configuring the server itself?   As an example, i have found this company (seems to be based in germany, although i have read that their datacenter is in france> https://www.hosteurope.de/en/WebServer/Comparison/ ) The 20 euro solution has 2GB quaranteed ram, unlimited MySQL databases on the HDD, 2 MySQL databases on a SSD (which would be ideal for the games data),100GB HDD storage (more than enough to store a ton of custom maps) and a "traffic flatrate", meaning that i have "theorethically" unlimited traffic. (Although they seem to have the right to limit the bandwidth of the server from 100Mbit down to 50Mbit if i start to stress the connection too much over a longer period of time.) The issue here is that they don't seem to specify how many cores are 'quaranteed" for this virtual webserver. (Probably none?)     My question now is: What kind of server (in terms of hardware like CPU and RAM) as well as traffic and bandwidth would be required in order to host a server like this? Especially if you have a bigger number of concurrent players (like 1000? Is this realistic?)   I don't want specifics, only a rough estimate in order to get an idea on how demanding that stuff can be. (Some of you may have done something similar before.)   If you have suggestions for companys which offer cheap services which could handle stuff like that i would love to check them out. :)   Of course, if it turns out that running such a server would be way too costly, then i would simply drop the whole masterserver altogether.
  14. Proprietary?    My bad. (Bad wording.) What i ment was that you need their client java code/api in order to connect to the server (which i sadly can't use as the game isn't written in java.)       Any networking library is going to have 'server' and 'client' entities that wrap up all the socket stuff and hide the details. These are just regular old objects that you use to create your actual server and client software. They aren't requiring you to use any sort of proprietary software, which seems to be what you are alluding to. And Kryonet is open source with a liberal license (the BSD three-clause). It won't impact releasing the source of your project at all, so there's no "code licensing" to worry about. If you're doing this as a learning exercise, that's fine, but if you want to just get stuff done, Kryonet is a fine option.   The problem is that while the server is written in java, the game isn't. This means that i would have to port the client side code in order to use it. (Which isn't worth it due to too much language differences.)   But thank you all for responding and giving me advice on this topic.
  15.   Looked at it, but it looks like you need to have their proprietary client in order to connect to their server. (And i can't do that as the client isn't written in java.) Additionally, i plan to release the source code of the server (for potential modding purposes) and not having to worry about any kind of code licensing is a nice bonus.     What it did for the time being is to rewrite the server and reduce most of the stuff to only specific threads. (And add a message Queue for passing messages from the TCP reciever thread to the rest of the system.) The TCP communication still works with the "one connection per thread" approach, but i can now easily swap that out in the future due to better code abstraktion in the server source code. (Once i get NIO working properly.)   I still have to profile that stuff though...