Jump to content
  • Advertisement

All Activity

This stream auto-updates     

  1. Past hour
  2. Today
  3. We have a lot of code that computes the length of a vector into a separate variable and then divides the vector through to normalize it. Enough that I'm tempted to make an extra helper function just for that usage pattern.
  4. Rewrote the entire post as I feel like it didn't capture our project and team well in the first place, as well as make clear the level and scope we're operating on. Hopefully this should clear some things up.
  5. That would work if you're wanting just the direction, but surely it would prevent being able to use the magnitude as e.g. speed or similar? I would say stuff x and y into a vector, and normalize the vector only if its magnitude is larger than 1 (something I've seen with an old/flimsy/faulty gamepad). Like Promit says, atan2 will give you the angle
  6. I was wondering if people here are already using blockchain for storing in game items and points, etc. I was playing around with the syscoin blockchain. It let's me make my own tokens very easily, I can also make my own blockchain marketplace, the speed of transfering these tokens is awesome. I was wondering if there are people with experience in using a blockchain as central storage? More info about blockchain API's : https://syscoin.network/syslinks/ (check the API & Development resources) . It seems to me this could also be used for registering software (for people that buy a paid license). Is there already a place in the forums for this (I could not find it). What are you guys doing with blockchain? Happy programming.
  7. NikiTo

    Programming and Higher Mathematics

    Modern programming was created in parts because not everybody is needed to know everything. Because a programmer could know about biology, other about physics, and all they can work together and program an app altogether. Abstractions and interfaces. A person without the most minimal knowledge in math can create the flowchart of a program. Math is a plus, but not a must have. In the future, programming as a whole will become pretty abstract. Now on competitions, genetic algorithms can create programs of such quality that no human can create. In the future "a programmer will be able to program for biology without knowledge of biology" In the future programming will become a philosophic science. In my second programming school the entrance exam had not math exam. Instead, it had an IQ exam. In my own opinion, introducing castes in a company is a bad thing. @Fulcrum.013 for example, is good at math but bad at english
  8. ??? Normalize the vector, or just compute the angle directly via arctangent (atan2).
  9. What you describe doesn't sound like what things should be like. Does the controller work like you want it to in other games or when calibrating it? (in Windows, you can configure/test a gamepad fairly easily). Alternatively, this seems to work as well: http://html5gamepad.com/ If it works, it's not the controller, it's your code/framework/implementation. If it doesn't work, try with a different controller. Personally, I'm guessing it's your implementation that's to blame. At a guess, are you adding each axis, and getting a total of >= 1? This is not what you should be doing.
  10. Thanks Greedy Goblin. The GPU is great for much more than just graphics related processing. Compute shaders are an easy way to do generic tasks when you're already familiar with shaders.
  11. Some computer configurations have multiple GPUs, e.g. gaming laptop with an Intel HD Graphics chip and a GeForce or Radeon chip. When enumerating through the available adapters on a computer, the Intel chip is the first one in most cases. However, I want to use the best adapter for my game. So I wrote the code below to create my swap chain: protected void CreateDevice(Size clientSize, IntPtr outputHandle) { ProcessLogger.Instance.StartFunction(this, "CreateDevice"); // Set swap chain flags, DXGI format and default refresh rate. _swapChainFlags = SharpDX.DXGI.SwapChainFlags.None; _dxgiFormat = SharpDX.DXGI.Format.R8G8B8A8_UNorm; SharpDX.DXGI.Rational refreshRate = new SharpDX.DXGI.Rational(60, 1); // Get proper video adapter and create device and swap chain. using (var factory = new SharpDX.DXGI.Factory1()) { SharpDX.DXGI.Adapter adapter = GetAdapter(factory); if (adapter != null) { ProcessLogger.Instance.Write(String.Format("Selected adapter: {0}", adapter.Description.Description)); // Get refresh rate. refreshRate = GetRefreshRate(adapter, _dxgiFormat, refreshRate); ProcessLogger.Instance.Write(String.Format("Selected refresh rate = {0}/{1} ({2})", refreshRate.Numerator, refreshRate.Denominator, refreshRate.Numerator / refreshRate.Denominator)); // Create Device and SwapChain ProcessLogger.Instance.Write("Create device."); _device = new SharpDX.Direct3D11.Device(adapter, SharpDX.Direct3D11.DeviceCreationFlags.BgraSupport, new SharpDX.Direct3D.FeatureLevel[] { SharpDX.Direct3D.FeatureLevel.Level_10_1 }); ProcessLogger.Instance.Write("Create swap chain."); _swapChain = new SharpDX.DXGI.SwapChain(factory, _device, GetSwapChainDescription(clientSize, outputHandle, refreshRate)); ProcessLogger.Instance.Write("Store device context."); _deviceContext = _device.ImmediateContext; } } ProcessLogger.Instance.EndFunction(this, "CreateDevice"); } For this function to work properly, I have to select the proper adapter in GetAdapter. Here is what it looks like: private SharpDX.DXGI.Adapter GetAdapter(SharpDX.DXGI.Factory1 factory) { List<SharpDX.DXGI.Adapter> adapters = new List<SharpDX.DXGI.Adapter>(); for (int i = 0; i < factory.GetAdapterCount(); i++) { SharpDX.DXGI.Adapter adapter = factory.GetAdapter(i); if (SharpDX.Direct3D11.Device.IsSupportedFeatureLevel(adapter, SharpDX.Direct3D.FeatureLevel.Level_10_1)) adapters.Add(adapter); } try { foreach (var adapter in adapters) if (adapter.Description.Description != null && (adapter.Description.Description.Contains("GeForce") || adapter.Description.Description.Contains("Radeon"))) { return adapter; } } catch { } return adapters.First(); } So all I am doing is asking my Factory1 for a list of all adapters that support FeatureLevel 10.1 and search for a "GeForce" or "Radeon" one. Very simple and use that one. This works like a charm. HOWEVER, there is one big problem: When I use this code in the Release build the game crashes when going to fullscreen using the code below. public void SetFullscreenState(bool isFullscreen) { if (isFullscreen != _swapChain.IsFullScreen) _swapChain.SetFullscreenState(isFullscreen, null); } The error code is DXGI_ERROR_UNSUPPORTED and after doing some research I found out, that this problem only happens for the Release build but not for the Debug build. The Debug build works like a charm. It also crashes only, if the selected adapter is not the first one in the list. So, if I use the first adapter (factory.GetAdapter(0)), it works! If I change my computer settings so that my GeForce is used as primary adapter for my game, it works. It only does not work for the Release build, if the selected adapter is not the first adapter in the list and I can't figure out why... The problem is independent from the used screen or other running applications in a multi-windowed application. I already tested that.
  12. alvaro

    Programming and Higher Mathematics

    Googleology will only get you so far. If you know linear algebra really well, you'll recognize vectors and linear mappings everywhere. If you don't know linear algebra really well, it might not occur to you that an audio signal is a vector, that the dot product can be used to define an angle between audio signals, which gives you a measure of similarity, or that the total energy of an audio signal is precisely the square of the length of the vector. Or that the definition of correlation in statistics is suspiciously similar to the definition of cosine in geometry; realizing this enables you to leverage your intuitions of geometry for statistics, or it can help you think of high-dimensional geometry using the intuitions from statistics. Just like geometry, signal processing and statistics, programming is another discipline in this same universe of related fields, and a programmer that knows nothing about the other fields and how to draw connections between them will always be a second-rank programmer.
  13. Just submitted a quick update to the AppStore. This makes the game compatible with iPhone X, XS, and XS Max. It will now use the whole screen. View the full article
  14. phil67rpg

    shooting bullets

    well I finally solved my problem
  15. Greedy Goblin

    Efficient Instancing in a Streaming Scenario

    Excellent article and some really awesome use of GPU shaders. I have yet to get stuck into compute shaders but it seems the possibilities are great!
  16. mrMatrix

    FBX SDK skinned animation

    Unfortunately Dirk that code didnt seem to help because it seems to be what I already have in my code. My model is still skewed. Did you notice the edit I put into my last post on page 3 where I said I had fixed the skeletal problem with a switch back to the old code? What could that imply or is it unimportant?
  17. Have you tried not adjusting the sizes you pass to System_SetState? As was mentioned earlier, it seems like the engine accounts for window styles, since the whole point is to abstract the OS dependent code away. Try just passing in the exact size you want your viewport to be, so if you want 800x600, pass in 800x600 directly, no adjustment. It seems like there's still some discrepancy between your client area, the render target, and/or your viewports/projection calculations. This all need to be set correctly and equal to prevent the types of aliasing issue you are seeing.
  18. Well I did a bit more research and tried implementing my own to at least understand BT's better. Using the actual object that the behavior tree controls looks like a much better alternative then some examples show. This however makes it mandatory to have to have references of everything the behavior tree might need inside it. But I have always found that a creature should be aware of the map and it's surroundings itself instead of having some kind of handler class for it. Another way I have been trying is to just pass a Map<String, Object> along the tree, an attack task would be run after a SearchEnemyTask task in sequence. The SearchEnemyTask tries to find an appropriate enemy and sets something along the lines of blackboard.put("target", targetEntity). Now this is a little less "safe" but does seem to be more versatile, if I ever want to create an automatic door using a BT I can just reuse openDoorTask on it instead of the above method where I would need to create a new Task with a Door as a blackboard. It's still hard to wrap my head around the complete concept but I'm getting there, but I was hoping for some more input here.
  19. I don’t know if I’m allowed ask this, so direct me to the right forum if I’m wrong please! I have an lcvp class and we need to interview someone in the line of work we want to go into, so I have some questions if anyone would like to answer :) My discord is @Yoshirouuu#7378 if you can’t answer here. What studio do you work for? What is the starting Salary? What do you enjoy about the job? What are the working hours? Is there much overtime? How much are you paid for overtime? What games have you worked on? What do you dislike about your job? What type of work is involved? What happens in a typical day? How did you get the job? (College course, Qualifications etc) When you got your job did you have to learn anything? (Programming language, applications?) Is there many opportunities for promotions? What days do you work? How many holidays are you allowed? Is there opportunity for travel in your job? Are there specific rules in your job? (Uniform?) What other areas/studios do you work with? Do you deal with public often? What is your favourite part about working on a game? Does your job have any benefits? Is there ever any conflicts or arguments? Were you able to make friends quickly? Thanks very much!
  20. Fulcrum.013

    Programming and Higher Mathematics

    Grandfather Lenin has said that only importend science is Marksism-Lenenism and other sciences is not importent. We all know what happend later with Soviet Union that has belive it tesis.
  21. lawnjelly

    Fixing your Timestep and evaluating Godot

    Spot on. Really you would think there should be support for previous, current and render transforms in the node base class. I am watching the Godot github site with interest to see whether anything happens on this, as a number of people have had issues with timestep jitter.
  22. jb-dev

    Vaporwave Roguelite

  23. JTippetts

    Fixing your Timestep and evaluating Godot

    I had a similar issue with retrofitting Urho3D to use a fixed timestep. I'm not doing that now, but when I was doing it my solution was to implement a special component to store last and current transforms and work through that. It worked well enough, but my games tend to not use physics, and as you mentioned, physics is where the madness lurks. Something built into the native Node would be better, I think, but would require modifying the library.
  24. Vilem Otte

    Suggestion for choosing challenges

    I'd vote for challenges being show on front page/index, although I have no idea how hard it would be for administrators.
  25. Fulcrum.013

    Programming and Higher Mathematics

    And we were told by Google that googlology dont worth a dime without understanding of sciences tat you googling. Now try to google pls "realtime torus-cylinder collision detection"
  26. Vilem Otte

    Test vote for next challenge

    Let me throw in some suggestions: Climber (or however you call the game where you have to get on top of something - like climbing in newer Tomb Raiders or old Platfomers) Swordfighting Doom
  27. Last week was a modelling one. There aren't a whole lot of new mechanics but it was still a productive week nevertheless. Custom Font Firstly, I've previously talked about creating a custom font to display some of the GUI icons. Well, with the use of FontForge, we were able to add vectorial art in a TrueType font. For those who don't know, FontForge is an open source font-making app. It's pretty advance and can actually make good looking fonts. There's a pretty acute learning curve though. If you're using it on Windows, you'll need to fiddle around with the setting though. Otherwise, it can really run with a whole lot of hiccups and crashes. With FontForge, you can actually import vectorial graphics right into the font. Because I've already had SVG files of most of my used icons, it was just a matter of a couple of clicks and everything was imported. However, it wasn't a piece of cake: although imported, we still need to properly align those graphics up so they could be properly displayed. With FontForge you can export the custom font to different file formats. Thankfully, we can export in TrueType, which is exactly the type of font file Unity uses. Once the TrueType file is created, we can then use Unity's dynamic font rendering to display our GUI icons at any resolution we need without rescaling and rerendering any texture. However, there's a big drawback: fonts are always monochromatic. If we want a coloured icon then we'll have no other option besides using a traditional bitmap texture. (Colour fonts do exits... However, their support isn't really widespread) But anyway, here's how it looks: New rooms Secondly, there are also two new rooms. All of these rooms are linked to crystals. Now that the player can know the number of crystals they currently have, those rooms can safely be integrated and tested without any hiccups. The Temple When visiting a temple, players can donate their crystals to gain back health points. To do this, the player simply needs to interact with the box at the back of the room while holding a crystal. Temples are modelled after Japanese Shinto temple/shrine. I've taken some liberties here and there but the overall theme is Japan. They are also much more open compared to other rooms. When the sun is right, the lighting can be quite charming. The Pawnshop The pawnshop isn't finished yet, but it's functional nevertheless. The player can exchange their crystals for a small amount of money by interacting with the yet-to-be-modelled cash register. Once finished, the pawnshop will have some fancy props here and there much like a typical pawnshop: things like guitars, jewellery and, of course, crystals. But for now, the room is kinda bland and boring... Minor updates There are also some new models and code refactors. For once, the diner now has a nice sign up on its roof: Aside from that, there aren't a whole lot of minor differences. Next week Like I've stated before, a lot of rooms can be added into the game now that most gameplay mechanics are coded. And there's still a whole lot of rooms to implement. Of course, I still need to model out the pawnshop and add its details. There might be some polishing to do with many gameplay mechanics and maybe a refactor or two. There's a lot of work ahead of me.
  1. Load more activity
  • 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!