GithubHelp home page GithubHelp logo

Comments (8)

mechPenSketch avatar mechPenSketch commented on May 18, 2024 1

Here is an example project:
grid_maps.zip

On the scene mesh_library.tscn, there are two kinds of terrains. Both are MeshInstance3D, and have their sizes adjusted to fit into the gridmap. They also each have a child node, Tile. The scene exported as a MeshLibrary, as mesh_library.tres.

On scene scene.tscn, there is a GridMap as a child node. In GridMap, Mesh Library is set to mesh_library.tres, and Size under Cell, Vector3(1, 0.5, 1). GridMap can be edited while selected in the scene tree.

Unfortunately, I don't have a way to prove that there is a Tile in each block of terrain, let alone access it. When it comes to access the blocks, the best I could do is to call get_cell_item(v3), which returns the MeshLibrary item index. Maybe adding a Tile as a child of a terrain block is the wrong approach.

BTW, how did you make a custom models with ArrayMesh when that's set for MeshInstance3D's Mesh? From looking at tutorials, scripting seems to be required, but your Arena's Terrain isn't attached to any script. Looking at your docs, its seems to be archieved by importing from Blender.

from godot-tactical-rpg.

mechPenSketch avatar mechPenSketch commented on May 18, 2024

An update to the example: grid_maps.zip

I have made one surface per item. However, this could be a problem if two items use the same grid. I cannot make a wall of the slope because of it.

Maybe instead, I should try to get a specific surface in a item?

from godot-tactical-rpg.

mechPenSketch avatar mechPenSketch commented on May 18, 2024

Another update: grid_maps.zip

This time, I used blender to customize my tiles. In Godot 4.0, you don't have to export your Blender files, instead you can use it directly in the editor.

Make sure Blender is enabled in Project > Project Settings...
godot_blender

And Blender 3 Path in Editor > Editor Settings... is set to the folder containing blender.exe:
godot_blender2

More information on using .blend in Godot can be found in Importing 3D scenes.

from godot-tactical-rpg.

ramaureirac avatar ramaureirac commented on May 18, 2024

Hi @mechPenSketch,

So the main idea in here is allow developers to "draw" an arena inside Godot editor using GridMaps. Something similar of what we can do on RPGMaker? (Please correct me if I'm mistaken).

If so, I still have some questions according to your PoC:

  1. This means every tile should be created separately and then used in Godot like "Kenney Assets" [1]? For instance taking as reference "Triangle Strategy" [2]: All blocks of the castle should be part of the GirdMesh and then the developer should put them together?

  2. How are we going to put a tile above the mesh using GridMaps? So far I'm not sure if is possible to attach a Mesh inside of a MeshGrid

[1] https://www.kenney.nl/assets/conveyor-kit
[2] https://cdn.mos.cms.futurecdn.net/dKBGAGnJXCoj7VeCg9QG5c.jpg

Thank you!
B.R.

from godot-tactical-rpg.

leonardoraele avatar leonardoraele commented on May 18, 2024

Having to manually position each individual tile in the right positions all over the arena is an uncacceptable workflow for a real project. I would love to see a better approach, since this is an example project.

I like the idea of using GridMaps because the tiles can be placed automatically by a script that reads the grid data. That is, assuming the Tile nodes are still needed at all—maybe, by reading the grid data, the arena.gd script might not even need the Tile nodes anymore.

Another idea is to write a @tool script that projects ray casts in a grid pattern covering the entire arena to figure out the positions and insert Tile nodes in the right places automatically.

@mechPenSketch It would be great if you could showcase your suggested changes in a fork to this repo. (github helps us by showing the diffs)

from godot-tactical-rpg.

mechPenSketch avatar mechPenSketch commented on May 18, 2024

@ramaureirac

  1. Yes, I think that's how it works.
  2. I initially thought I could access the children Tiles, but since GridMaps don't add cell items as its child node, I'm looking at other options.

@leonardoraele It'll be nice if I could access a specific face of a call item so I don't worry about tile nodes. Looks complex, but possible.

from godot-tactical-rpg.

ramaureirac avatar ramaureirac commented on May 18, 2024

@mechPenSketch IMO i don't think GrindMaps is necessarily a replacement for current Blender system, but a plus for giving more freedom in the way a user is creating a level.

I been playing with RayCasting and SurfaceTool for some months now in order to move Blender step into Godot vía @tool, something similar of what @leonardoraele mentioned. Maybe this feature can support both methods at same (One single mesh or GridMaps).

However my only issue is code base is ugly, and it got worse when moving to Godot 4, so probably I will have to clean and refactor some stuff before adding/accepting new scripts/features to this project.

from godot-tactical-rpg.

mechPenSketch avatar mechPenSketch commented on May 18, 2024

^ It sounded good in my head, but yeah, the more I worked on it, the more I realized it's no less complecated.

from godot-tactical-rpg.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.