Im making a game in Rust(Im a beginner) for my son and am somehow struggling with platforms - specifically modifying their length. I can get the platforms if i use certain numbers but if i try to modify the platform width I run into problems.
If i use the const PLATFORM_WIDTH=400 then everything works fine (i seemingly can make any number of them and it all works), but I don't want to have platforms of a fixed width (length), I want each platform to be of variable width. If I try to make the platform width say 100.0 then it is rendered correctly but I can walk over empty space as if there was a platform there. If I make them greater than 400 they are rendered but the sprite will fall through solid floor at some points.
Really don't know where Im going wrong and this annoying issue is preventing me from making progress on my game.
Id really appreciate if someone could take a look at my code and tell me where im going wrong.
My code is here:
https://github.com/country-bumpkin-software/rusty-miner/blob/main/src/main.rs
Also can someone explain to me why the Rect function seems to take negative numbers for the x, y coords?
The problem is that you sometimes use the width from the platform struct (e.g. when checking for intersections on line 264) and sometimes use the PLATFORM_WIDTH and PLATFORM_WIDTH_HALF constants (e.g. when drawing the platform on line 346).
As mentioned in the question, I build a kivy app and deploy it to my android phone. The app works perfectly on my laptop but after deploying it the font size changes all of a sudden and become very small.
I can't debug this since everything works fine. The only problem is this design or rather the UI.
Does anyone had this issue before? Do you have a suggestion how to deal with it?
PS: I can't provide a reproducible code here since everything works fine. I assume it is a limitation of the framework but I'm not sure.
It sounds like you coded everything in terms of pixel sizes (the default units for most things). The difference on the phone is probably just that the pixels are smaller.
Use the kivy.metrics.dp helper function to apply a rough scaling according to pixel density. You'll probably find that if you currently have e.g. width: 50, on the desktop then width: dp(50) will look the same while on the phone it will be twice as big as before.
PS: I can't provide a reproducible code here since everything works fine.
Providing a minimal runnable example would, in fact, have let the reader verify whether you were attempting to compensate for pixel density.
I followed the Lighting tutorial on learnopenGL, modifying some of the code to work in a 2D game engine. Everything was looking great and my team got our game done and the lights were quite simple for our designers to use. However we ran into a rare bug. as shown here: https://www.youtube.com/watch?v=to0mMP5I0cs one team member was able to recreate the bug by switching his Nvidia settings to use the "High Performance Processor" as opposed to "Integrated Graphics". Otherwise everything renders properly. The bug doesn't appear when there are no lights and everything is rendered in its full color. We have gone through alot of Ideas already but they haven't worked and now I am at a loss. Does anyone have any ideas about what is going on?
Always make sure you initialize your variables. Apparently some cards and drivers automatically initialize vec3 to (0,0,0), but others don't. That was what was going on here. Garbage values causing different colors at each fragment. By Initializing my resulting color vec3 to (0,0,0) at the beginning the problem is fixed.
I'm creating a procedural terrain in unity with hexagons. When the camera is fairly close the textures and colours work perfectly fine but... as soon as I zoom out I get this.
Map view from an angle:
As you can see I get these weird dots that become more exagerated the further I zoom...
When I'm up close I don't get this and the hexes blend very well toghether.
The textures blend very nicely when it's close and you can't see any boundaries. But as you go further out, some dots start appearing and even further so the colours get completly distorted.
Does anyone know what's causing it and how it could be fixed? I'm sorry, I'm really new to unity and this is my first unity project
Also, I presume this wouldn't be due to the texture bleding at boundaries because when I set the colour of the hexagons to be the same, I still get that effect.
(for example the sea in the pic below)
Same Colour hexes still show the problem
And when it gets further out, the problem pops up
Any help would be greatly appreciated! :)
Hmm, these might be artifacts caused by mipmapping (lower texture resolution as you zoom out). Try disabling mipmaps in your textures. It will negatively affect your game's performance but it might fix the problem.
Like any responsible developer, I'd like to make sure that the sites I produce are accessible to the widest possible audience, and that includes the significant fraction of the population with some form of colour blindness.
There are many websites which offer to filter a URL you feed it, either by rendering a picture or by filtering all content. However, both approaches seem to fail when rendering even moderately complex layouts, so I'd be interested in finding a client-side approach.
The ideal solution would be a system filter over the whole screen that can be used to test any program. The next best thing would be a browser plugin.
I came across Color Oracle and thought it might help. Here is the short description:
Color Oracle is a colorblindness simulator for Windows, Mac and Linux. It takes the guesswork out of designing for color blindness by showing you in real time what people with common color vision impairments will see.
Color Oracle is great, but another option is KMag, which is part of KDE in Linux. It's ostensibly a screen magnifier, but can simulate protanopia, deuteranopia, tritanopia and achromatopsia.
It differs from Color Oracle by requiring an additional window in which to display the re-coloured image, but an advantage is that one can modify the underlying image at the same time as previewing the simulation.
Here is a screenshot showing the original figure on the left, and the KMag window on the right, simulating protanopia.
Here's a link to a website that simulates various kinds of color blindness:
http://www.vischeck.com/
They let you check URL's and Screenshots with three kinds of different color blindness types (URL checking is a bit dated though. Image-check works better).
I'd encourage everyone to check their applications btw. Seeing your own app with others eyes may be an eye opener (pun intended).
I know this is a quite old question, but I've recently found an interesting solution to transparently simulate color blindness.
When working with Linux, you can simulate color blindness using the Color Filter plugin for Compiz. It comes with profiles for deuteranopia and protonopia und changes the colors of the whole screen in real-time.
It's very nice because it works transparently in all applications (even within Youtube-Videos), but it will only work where Compiz is available, e.g. only under Linux.
Here's an article that has some guidelines for optimizing UI for color blind users:
Particletree ยป Be Kind to the Color Blind
It contains a link to another article with the kind of tools you were asking for:
10 colour contrast checking tools to improve the accessibility of your design | 456 Berea Street
A great paper that explains a conversion that preserves color differences is:
Detail Preserving Reproduction of color images for Monochromats and Dichromats.(PDF)
I haven't implemented the filter, but I plan to when I have some more free time.
I found Colour Simulations easy to use on Windows 10. This software can apply a color-blind filter to a part of the screen or the whole screen. And what's great is it allows me to interact with my PC normally as if it doesn't exist in fullscreen mode. It runs quite slow in my 4K screen using an integrated graphics card, though.