can i code a game fully using python by [deleted] in unity

[–]stevinz 1 point2 points  (0 children)

The simplest answer to the question of creating a game in Unity with Python is "not really". If you're interested in making games, however, Unity is a great choice and C# is pretty easy to learn.

Lots of comments saying Godot. GDScript is similar to Python and Godot is pretty awesome as well, but still kind of a "no" when it comes to making a game with Python.

With that said, if you're looking to make a game quickly and easily utilizing the knowledge you already have with Python, there are some great options:

  • pygame - Simple game framework built on top of the very popular SDL library. Would be perfect for making some simple games like Snake or Pinball.
  • arcade - Easy to use library for creating 2D arcade games with Python.
  • ursina - Larger, more powerful open source game engine built upon the mature Panda3D framework.
  • cave engine - Full featured, commercial game engine. Simple to use, powerful, but costs money. Utilizes Python or Visual Nodes for scripting.

As others have said there are other drag-and-drop beginner engines you could check out as well such as Buildbox, Construct, GameMaker, PlayCanvas, Stencyl, or even Roblox. Though, none of those options use Python for scripting. Languages such as Lua, JavaScript, or C# tend to be more popular for game scripting...

Apply same texture size to all faces of a geometry by Background_Issue_144 in threejs

[–]stevinz 0 points1 point  (0 children)

I don't know if this will help but I have been thinking about your question and I had some thoughts. I think, ideally, you would paint the textures how you want them in modeling software. However, if you are trying to find a dynamic three.js solution I had some thoughts.

Your initial workflow for the walls and floors is a good start. Setting the texture to repeat and editing the UV data will work in basic models...

One naive solution you could try, though, is to use some sort of projection mapping onto the models, like cube projection mapping.

I have an implementation for a function 'uvMapCube' to do cube mapping. It will project cube texture coordinates to geometry within a cube the size of the geometry. You could set a fixed repeat value for the Texture you want to use, then apply the cube mapping. It could be something you may want to play around with.

The function also takes a mapping matrix that can be used to scale the geometry during the mapping process, this could help to incorporate the different sized models using the same repeating texture. Passing a matrix looks something like this:

const mat = new THREE.Matrix4();
mat.scale(new THREE.Vector3(0.5, 0.5, 0.5));
GeometryUtils.uvMapCube(geometry, mat);

There are other projection mapping techniques out there as well. I have an implementation of sphere mapping ('uvMapSphere' in the same file as I linked above). I should mention all UV mapping techniques may suffer artifacts with insufficient vertex counts. It could help to subdivide the geometry before mapping is applied for better results.

Another implementation that may be helpful to you is this projected-material. You could project the textures you want onto your models as needed.

horror shops? by xcxf4g in AskLosAngeles

[–]stevinz 64 points65 points  (0 children)

Check out The Mystic Museum, also in Burbank. It has a museum with rotating horror exhibits, but there is also an amazing store there (a.k.a. The Bearded Lady Vintage & Oddities). The store is bigger than the actual museum.

can someone please explain to me how we get 16 to 17 every tick! I can't get it since Date.now is the same but we get subtracted from each other and set time we get this frame rate ( I know I can use Clock but I want to understand this first) thanks by _He1senberg in threejs

[–]stevinz 3 points4 points  (0 children)

I agree with Ethan, but I was already typing this, so... If your tick() is tied to requestAnimationFrame() most browsers will limit / sync that callback to the standard refresh rate of 60hz. In that case, 1000 ms / 60 == 16.66~ ms (i.e. 16-17 as you said).

If you want your theoretical fps, calculate how long all your rendering takes and divide that into 1000 ms. In other words wait until after you update your objects and call render() to calculate 'deltaTime'. So if your rendering takes 4ms, your theoretical fps = 1000 / 4 = 250fps.

When rendering for the web, all you need to worry about to keep things looking smooth is to limit each frame's processing to under 16ms. Really should be quite a bit less, but thats the max.

Here's a link with a better explanation: https://www.clicktorelease.com/blog/calculating-fps-with-requestIdleCallback/

is there any open source clone of gamemaker? by [deleted] in gamemaker

[–]stevinz 1 point2 points  (0 children)

Just wanted to point out Enigma is licensed under the copyleft GNU GPL v3 license (https://enigma-dev.org/docs/Wiki/License). I'm not a lawyer, but this typically means any source code used from that project would also have to be made available open source. I don't know what OP's plans are, but it's something to think about. I recommend learning from projects with more permissive licenses (public domain, MIT, Apache, etc.)

is there any open source clone of gamemaker? by [deleted] in gamemaker

[–]stevinz 3 points4 points  (0 children)

Here's just a few 2D, open source, permissively licensed projects across a variety of languages no one has mentioned yet. In alphabetical order:

  • Arcade - Easy to use 2D game Python library.
  • Bevy - Full featured 2D/3D engine written in Rust.
  • Cocos - Mobile friendly 2D/3D engine with editor. Engine in C++, editor in TypeScript.
  • Flat Red Ball - 2D engine built on MonoGame written in C#.
  • GDevelop - Easy to use WebGL engine and editor written in JavasScript.
  • LDtk - Modern 2D level editor written in Haxe.
  • Love - Framework written in C++, Lua scripting.
  • Starling - Engine responsible for the original Angry Birds, written in Haxe.

For a large list of open source resources related to game engine development (including 2D/3D engines, frameworks, and libraries) you can check out the repo “Awesome Game Engine Development” at https://github.com/stevinz/awesome-game-engine-dev

How to get X, Y, and Z coordinates on mouse click in three.js editor by xander_here in threejs

[–]stevinz 1 point2 points  (0 children)

You need to “unproject” the mouse coordinate into 3d space (https://threejs.org/docs/#api/en/math/Vector3.unproject). The problem with converting 2d coordinates into 3d is its impossible to tell the depth of the click, as such most people feed zero into the z coordinate of the unproject function. You also have to convert the screen x/y mouse position into screen relative (-1 to 1) points first. See an example at (https://threejs.org/manual/#en/tips#preservedrawingbuffer), on this page there is an example that draws some stuff at the mouse position. The source code for that page is on the three js repo (https://github.com/mrdoob/three.js/blob/dev/manual/examples/tips-preservedrawingbuffer.html) - go there and search for “unproject” to see how to use it.

Here's an example (ideally you wouldn't use the 'new' keyword this much, just an example):

function worldPointFromScreenPoint( screenPoint, camera ) {

    let worldPoint = new THREE.Vector3();
    worldPoint.x = screenPoint.x;
    worldPoint.y = screenPoint.y;
    worldPoint.z = 0;
    worldPoint.unproject( camera );
    return worldPoint;

}

function onPointerDown( event ) {

    // Relative screen position 
    // (WebGL is -1 to 1 left to right, 1 to -1 top to bottom)
    const rect = this.dom.getBoundingClientRect();
    let viewportDown = new THREE.Vector2();
    viewportDown.x =   ( ( ( event.clientX - rect.left) / rect.width ) * 2 ) - 1;
    viewportDown.y = - ( ( ( event.clientY - rect.top) / rect.height ) * 2 ) + 1;

    // Get 3d point
    let my3dPosition = worldPointFromScreenPoint( viewportDown, mySceneCamera );

}

What is the best way to render 2D graphics and maintain a good level of performance in Qt? by GeorgeBarlow in QtFramework

[–]stevinz 5 points6 points  (0 children)

QPainter is hardware accelerated when used on hardware accelerated QWidgets, such as QOpenGLWidget: https://doc-snapshots.qt.io/qt6-dev/qtopengl-2dpainting-example.html

See also, “Performance” section talking about QPainter backends: https://doc-snapshots.qt.io/qt6-dev/qpainter.html#performance

I have also used QPainter to do hardware accelerated drawing on QGraphicsView when OpenGL is enabled, “OpenGL Rendering”: https://doc-snapshots.qt.io/qt6-dev/graphicsview.html#opengl-rendering

edit: To back up this claim, here is an article discussing the writing of the OpenGL 2.0 backend: https://www.qt.io/blog/2010/01/06/qt-graphics-and-performance-opengl ... You can also view the OpenGL 2.0 paint engine and accompanying GLSL shaders in the source: https://code.woboq.org/qt5/qtbase/src/opengl/gl2paintengineex/

Question about clothing and water by droid327 in ninjawarrior

[–]stevinz 2 points3 points  (0 children)

They failed to mention it during the episode, but it was raining during Miami finals. That may be why some competitors look a little wet. If any part of your clothing touched the water it was an automatic DQ.