Jump to content
Sign in to follow this  
XXon

The Mystic Wood

Recommended Posts

I am working on a game inspired by The Mystic Wood, an old board game, in which you lay out a grid of 45 map cards, face down. When you enter the new area, you flip over the card and see what is there. Sometimes the new map card has three doorways, sometimes four, maybe you fight a monster or draw a card, etc. As you move around, a map develops and you try to get to the other side first to win. It is a very enjoyable game and I like the simplicity of the map tiles.

I made a series of rooms, each the same size,with three doorways all in the same place so they align no matter the rotation. The next room spawns right in front of your amazed eyes as you pass through the doorway into it, just like flipping over the Mystic Wood card. I preplace a grid of thin doorway trigger zones,  relying on the rotation of the trigger zone to figure the position of the next room. You go South, the room triggers at a random rotation, but always to the South fifteen blocks. Each door triggers once only. Of course, if you come through the same doorway going North, then spawning to the South doesn't work so well. That sets the stage for my problem.

Given the random map, sometimes you can double spawn a room by circling back around and using a door previously passed over and unused. You enter going North and the room you are already standing in respawns under your feet because the trigger direction says spawn to the South, which works if you used the door the first time through, but not when you circle around and use it for the first time.  How can I prevent this double spawn?

Any thoughts on this? Thanks!

P.S. This has been driving me nuts for days.

 

 

 

Share this post


Link to post
Share on other sites

Hey, there are probably a few ways of doing this. The first that comes to mind is making a 2d array to keep track of all your rooms, you could just use a boolean type to track if a room has spawned in a certain position on the grid, or use another type if you want to store some more info. Then before spawning a room check your 2d array to see if a room has been spawned there.

let me know if you've got more questions.

  • Upvote 1

Share this post


Link to post
Share on other sites

I made each randomly chosen room spawn on a reference point. Upon trigger, if the reference point has no label, it spawns the room and adds a label to the reference point. Your way is more graceful, but my lack of skill limits me. Thanks for the correct method.

Share this post


Link to post
Share on other sites

In some ways your method is quite similar, well done for solving the problem your way that's how you learn?

Share this post


Link to post
Share on other sites

I can spawn a map tile by welding it into one entity, but that doesn't transfer any game logic, just the entities.

I think I have worked out how to rotate the game logic and spawn it correctly on the map tile. I cannot seem to spawn any water, however. It's not an entity and it's not game logic. Is it possible to spawn water?

 

Share this post


Link to post
Share on other sites

I havnt really messed around with terrain much but I just had a quick look and I dont think its possible to spawn water. Perhaps you could have your whole play field a water volume and map tiles just spawn above it, then where the ground level is lower you will have water. Not exactly sure how your map works though. 

 

Share this post


Link to post
Share on other sites

I can spawn the logic in the right spot, but I am trying to spin the logic position relative to the center of the map tile. So the map can spawn at any rotation and the trigger zone spawns in the right spot.

X+X, Z-Z = 0 map rotation, X-X, Z-Z = 90, etc. How can I set Z and X individually?

The water playing field is not a bad idea. Thanks.

Share this post


Link to post
Share on other sites

If I understand correctly what you are asking you can use the vector tile that splits up the vector into separate x, y and z sections.

  • Like 1

Share this post


Link to post
Share on other sites

That worked. Thanks. Now it all works, I just need to put the instructions together. Wish I could cut and paste sections from different scripts together. Feel free to critique. I appreciate your help.

The difference in rotation degree is in the final math. Both +, both -, one + one -, one - one+ for 0, 90, 180 and 270 degrees.

 

 

20210820180317_1.jpg

Edited by XXon
It works!

Share this post


Link to post
Share on other sites

If you find you are repeating a lot of your code it often means you need to use a function or as Ylands calls them an instruction, if you create these in a global storage you can access the functions from any other game logic. You put all your code into the instruction and then you can 'call' it from another place with just one block. 

  • Upvote 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×