[Mod] Gears and axles [gear3d] [0.2] [WIP]

Chem871
Member
Posts: 999
Joined: Sat Aug 19, 2017 21:49
GitHub: Chemguy99
In-game: Chem Nyx
Location: My Basement's Attic

Re: [Mod] Gears and axles [gear3d] [0.2] [WIP]

by Chem871 » Post

Wow. +3
What is SCP-055?

User avatar
stu
Member
Posts: 923
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11
Location: United Kingdom

Re: [Mod] Gears and axles [gear3d] [0.2] [WIP]

by stu » Post

sorcerykid wrote:Wait, what about steampunk? I mean heck, the mod is even called "gears and axles" :P
There are already so many automation mods catering to the cyberpunk aesthetic. Steampunk would be an excellent alternative for games that are set within a pre-industrial civilization (such as the Victorian or late Medieval ages) but could benefit from machinery. Just an idea!
Indeed, my love of steampunk was my main inspiration for this. That is exactly what I meant by also exploring the early industrial revolution.
v-rob wrote:This mod is turning out wonderfully, but, although it bypasses server-side lag with entities, it induces client-side lag due to the sheer number of polygons there are, even though they are invisible. Placing down just a few belts and gears causes noticeable framerate drop, and placing a lot causes framerates >=10 for me.
You are quite right to point out that these models are relatively large in terms of polys, however, they are nothing really that far out of the ordinary for other non-voxely games. I don’t really see any impact on framerate with my pc, even with my demo setup, your gpu should be sensible enough to not render the transparent faces. I do see a slight drop on my phone but certainly no more so than a dense forest or jungle.

You could try enabling wireframe mode, it should look something like this:

Image
ShadMOrdre wrote: One thing I've noticed is that the chain and the 90degree gears animations are a little out of synch. If you make a square chain, with 4 sprockets at the corners, you should see what I mean.

As for the backend mechanics, I think a simple pass through logic would work. What I mean here is, instead of trying to implement the depth of elepower or tubelib, simply provide an on/off kind of logic. I component A is connected to component B, and B is on, then A is on. A right click on a break switch to either allow the sail to turn in the wind or to stop it, and everything connected in between then is either on or off.
Yeah, I realize the chains are rather awkward to line up correctly with the basic screwdriver but I also found that a reversed chain is also needed in some cases. I have just pushed a fix though because of the naming convention it will break existing builds, my own included :(

It could also be due to the fact that all repeating animations can get out of sync in MT at what appears to be mapblock and/or chunk boundaries. I seem to recall some issue for this but can’t seem to locate it, I can maybe have a shot at fixing it unless there is some reason why this may be non-trivial.

Your idea for the backend sounds like exactly the sort of thing I’m after, although I would also like to include the possibility of reversal for some items, you’ve definitely given me some ideas there, thanks!
ShadMOrdre wrote:PS. When do we get to see the plane available?
That is even more WIP than this but I promise I will publish what I’ve got once MT 5.0.0 is finally released, just to celebrate =)

ShadMOrdre
Member
Posts: 1118
Joined: Mon Dec 29, 2014 08:07
Location: USA

Re: [Mod] Gears and axles [gear3d] [0.2] [WIP]

by ShadMOrdre » Post

stu,

So I wrote this, based on your release from yesterday.
Spoiler

Code: Select all

lib_gear = {}

minetest.register_node("lib_gear:sprocket_on", {
	description = "Sprocket On",
	drawtype = "mesh",
	mesh = "gear3d_sprocket.obj",
	tiles = 	{
		{
			name = "gear3d_sprocket_fwd.png",
			animation = {
				type = "vertical_frames",
				aspect_w = 192,
				aspect_h = 30,
				length = 1,
			},
		},
	},
	paramtype = "light",
	paramtype2 = "facedir",
	walkable = false,
	selection_box = {
		type = "fixed",
		fixed = {-0.75, -0.75, -0.25, 0.75, 0.75, 0.25},
	},
	groups = {choppy=2, oddly_breakable_by_hand=1},

	on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
		minetest.swap_node( pos,  {name = "lib_gear:sprocket_off", param1 = node.param1, param2 = node.param2}  );
	end,

	on_place = function(itemstack, placer, pointed_thing)
		if pointed_thing.type ~= "node" then
			return itemstack
		end

		local p0 = pointed_thing.under
		local p1 = pointed_thing.above
		local param2 = 0

		local placer_pos = placer:getpos()
		if placer_pos then
			local dir = {
				x = p1.x - placer_pos.x,
				y = p1.y - placer_pos.y,
				z = p1.z - placer_pos.z
			}
			param2 = minetest.dir_to_facedir(dir)
		end

		if p0.y-1 == p1.y then
			param2 = param2 + 20
			if param2 == 21 then
				param2 = 23
			elseif param2 == 23 then
				param2 = 21
			end
		end

		return minetest.item_place(itemstack, placer, pointed_thing, param2)
	end,
	
})

minetest.register_node("lib_gear:sprocket_on_rev", {
	description = "Sprocket On Reversed",
	drawtype = "mesh",
	mesh = "gear3d_sprocket.obj",
	tiles = 	{
		{
			name = "gear3d_sprocket_rev.png",
			animation = {
				type = "vertical_frames",
				aspect_w = 192,
				aspect_h = 30,
				length = 1,
			},
		},
	},
	paramtype = "light",
	paramtype2 = "facedir",
	walkable = false,
	selection_box = {
		type = "fixed",
		fixed = {-0.75, -0.75, -0.25, 0.75, 0.75, 0.25},
	},
	groups = {choppy=2, oddly_breakable_by_hand=1},

	on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
		minetest.swap_node( pos,  {name = "lib_gear:sprocket_off", param1 = node.param1, param2 = node.param2}  );
	end,

	on_place = function(itemstack, placer, pointed_thing)
		if pointed_thing.type ~= "node" then
			return itemstack
		end

		local p0 = pointed_thing.under
		local p1 = pointed_thing.above
		local param2 = 0

		local placer_pos = placer:getpos()
		if placer_pos then
			local dir = {
				x = p1.x - placer_pos.x,
				y = p1.y - placer_pos.y,
				z = p1.z - placer_pos.z
			}
			param2 = minetest.dir_to_facedir(dir)
		end

		if p0.y-1 == p1.y then
			param2 = param2 + 20
			if param2 == 21 then
				param2 = 23
			elseif param2 == 23 then
				param2 = 21
			end
		end

		return minetest.item_place(itemstack, placer, pointed_thing, param2)
	end,
	
})

minetest.register_node("lib_gear:sprocket_off", {
	description = "Sprocket Off",
	drawtype = "mesh",
	mesh = "gear3d_sprocket.obj",
	tiles = 	{ "gear3d_sprocket_fwd.png^[verticalframe:12:0", },
	paramtype = "light",
	paramtype2 = "facedir",
	walkable = false,
	selection_box = {
		type = "fixed",
		fixed = {-0.75, -0.75, -0.25, 0.75, 0.75, 0.25},
	},
	groups = {choppy=2, oddly_breakable_by_hand=1},
	
	on_punch = function(pos, node, puncher, pointed_thing)
		minetest.swap_node( pos, {name = "lib_gear:sprocket_on", param1 = node.param1, param2 = node.param2} );
	end,

	on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
		minetest.swap_node( pos, {name = "lib_gear:sprocket_on_rev", param1 = node.param1, param2 = node.param2} );
		-- if clicker:get_player_control().sneak then
			-- minetest.swap_node( pos, {name = "lib_gear:sprocket_on_rev", param1 = node.param1, param2 = node.param2} );
		-- else
			-- minetest.swap_node( pos, {name = "lib_gear:sprocket_on", param1 = node.param1, param2 = node.param2} );
		-- end
	end,

	on_place = function(itemstack, placer, pointed_thing)
		if pointed_thing.type ~= "node" then
			return itemstack
		end

		local p0 = pointed_thing.under
		local p1 = pointed_thing.above
		local param2 = 0

		local placer_pos = placer:getpos()
		if placer_pos then
			local dir = {
				x = p1.x - placer_pos.x,
				y = p1.y - placer_pos.y,
				z = p1.z - placer_pos.z
			}
			param2 = minetest.dir_to_facedir(dir)
		end

		if p0.y-1 == p1.y then
			param2 = param2 + 20
			if param2 == 21 then
				param2 = 23
			elseif param2 == 23 then
				param2 = 21
			end
		end

		return minetest.item_place(itemstack, placer, pointed_thing, param2)
	end,
	
})
All this currently does, is allow a LMB punch to trigger forward motion, a RMB use to trigger reverse animation, and to stop either motion. Ideally, a sneak RMB to change direction state, and RMB to initiate action. I'm a little distracted today, but I'd like to help. On/off, but this should be with a "brake" node (the switch) somewhere, for realism.

I'm not yet sure how best to implement the power part, transferring power between nodes. Fluid_lib gives me ideas to get started, but this might be for someone else with better skills.

User avatar
v-rob
Developer
Posts: 970
Joined: Thu Mar 24, 2016 03:19
GitHub: v-rob
IRC: v-rob
Location: Right behind you.

Re: [Mod] Gears and axles [gear3d] [0.2] [WIP]

by v-rob » Post

stu wrote:You are quite right to point out that these models are relatively large in terms of polys, however, they are nothing really that far out of the ordinary for other non-voxely games. I don’t really see any impact on framerate with my pc, even with my demo setup, your gpu should be sensible enough to not render the transparent faces. I do see a slight drop on my phone but certainly no more so than a dense forest or jungle.
Well, I just realized that my laptop gives me an average of 40 fps during normal play :-o. I hadn't actually noticed that before, and it's not particularly old. Anyway, for me, if I place a 4x4 grid of millstone rollers, I will achieve a wonderful 20 fps. It drops to 10 if I stand in the middle of them. Maybe my GPU is stupid after all :-(

Image
Attachments
screenshot_20190302_163813.png
screenshot_20190302_163813.png (917.95 KiB) Viewed 1376 times
Core Developer | My Best Mods: Bridger - Slats - Stained Glass

User avatar
GreenXenith
Member
Posts: 1356
Joined: Wed Oct 28, 2015 01:26
GitHub: GreenXenith
Location: UTC-8:00
Contact:

Re: [Mod] Gears and axles [gear3d] [0.2] [WIP]

by GreenXenith » Post

v-rob wrote:
stu wrote:You are quite right to point out that these models are relatively large in terms of polys, however, they are nothing really that far out of the ordinary for other non-voxely games. I don’t really see any impact on framerate with my pc, even with my demo setup, your gpu should be sensible enough to not render the transparent faces. I do see a slight drop on my phone but certainly no more so than a dense forest or jungle.
Well, I just realized that my laptop gives me an average of 40 fps during normal play :-o. I hadn't actually noticed that before, and it's not particularly old. Anyway, for me, if I place a 4x4 grid of millstone rollers, I will achieve a wonderful 20 fps. It drops to 10 if I stand in the middle of them. Maybe my GPU is stupid after all :-(

Image
Mine must be too. With a 7x7 array of mill stones I get 15FPS while standing in the middle, whilst I get ~300FPS elsewhere. I have a GeForce GT 710.
YouTube | Mods | Patreon | Minetest Discord @greenxenith

You should not be able to read this message.

User avatar
Desour
Member
Posts: 1469
Joined: Thu Jun 19, 2014 19:49
GitHub: Desour
IRC: Desour
In-game: DS
Location: I'm scared that if this is too exact, I will be unable to use my keyboard.

Re: [Mod] Gears and axles [gear3d] [0.2] [WIP]

by Desour » Post

GreenDimond wrote:whilst I get ~300FPS elsewhere
What is your fps_max setting set to?!
stu wrote:your gpu should be sensible enough to not render the transparent faces
As far as I know, invisible faces are rendered, too:
[url=https://github.com/minetest-mods/mesecons/pull/321#issuecomment-280465587]here[/url] numberZero wrote:transparent polygons seem to affect FPS just like opaque ones.
Probably it would help if the animation was less smooth.
Currently there are 24 steps per full turn and 1/12 second per step. This means for a gear with the radius of a half node (and ergo the diameter of a whole node) that the most outer part of the gear jumps pi/24 = 0.13 nodelengths twelve times in a second. Imo 3 times in a second would perhaps even be enough, it doesn't have to be so smooth.
he/him; Codeberg; GitHub; ContentDB; public personal TODO list; "DS" is preferred (but often too short)

User avatar
stu
Member
Posts: 923
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11
Location: United Kingdom

Re: [Mod] Gears and axles [gear3d] [0.2] [WIP]

by stu » Post

ShadMOrdre wrote:stu,
So I wrote this, based on your release from yesterday.

All this currently does, is allow a LMB punch to trigger forward motion, a RMB use to trigger reverse animation, and to stop either motion. Ideally, a sneak RMB to change direction state, and RMB to initiate action. I'm a little distracted today, but I'd like to help. On/off, but this should be with a "brake" node (the switch) somewhere, for realism.

I'm not yet sure how best to implement the power part, transferring power between nodes. Fluid_lib gives me ideas to get started, but this might be for someone else with better skills.
Thanks, that looks like a good starting point, I will try to include some basic functionality like this as soon as get I some of my older mods updated for the MT 5.0.0 release.
GreenDimond wrote:
v-rob wrote:
stu wrote:You are quite right to point out that these models are relatively large in terms of polys, however, they are nothing really that far out of the ordinary for other non-voxely games. I don’t really see any impact on framerate with my pc, even with my demo setup, your gpu should be sensible enough to not render the transparent faces. I do see a slight drop on my phone but certainly no more so than a dense forest or jungle.
Well, I just realized that my laptop gives me an average of 40 fps during normal play :-o. I hadn't actually noticed that before, and it's not particularly old. Anyway, for me, if I place a 4x4 grid of millstone rollers, I will achieve a wonderful 20 fps. It drops to 10 if I stand in the middle of them. Maybe my GPU is stupid after all :-(
Mine must be too. With a 7x7 array of mill stones I get 15FPS while standing in the middle, whilst I get ~300FPS elsewhere. I have a GeForce GT 710.
I fully accept that setups like that are going to affect framerates on lower end devices, however, I do not think this is a very fair test. There are plenty of other mods/objects that can bust your fps if you go OTT with them :P Eventually, you won’t be able to place these in such close proximity, nor will you be able to clip through them as you can now.
DS-minetest wrote:
[url=https://github.com/minetest-mods/mesecons/pull/321#issuecomment-280465587]here[/url] numberZero wrote:transparent polygons seem to affect FPS just like opaque ones.
I would not doubt numberZero (or yourself) I was mostly just going off what I see in wireframe mode. My fps is locked to vsync so it’s hard to say exactly, my pc is really nothing that special nowadays, It was a half decent gaming pc once but is now over 7 years old!
DS-minetest wrote:Probably it would help if the animation was less smooth.
This is certainly an option if framerate does prove to be a genuine problem. I think I could at least half the poly-count of most objects without losing too much realism. The file sizes can be reduced significantly by using a binary format like b3d, I will do this once I clean up and release the master .blend files for them.

parasite
Member
Posts: 186
Joined: Sat May 06, 2017 17:45
GitHub: Parasitoid

Re: [Mod] Gears and axles [gear3d] [0.2] [WIP]

by parasite » Post

Wow! It looks pretty cool!
But placement of all these individual elements to make a complex structure is not so easy ;)

Bag0Cheese
Member
Posts: 48
Joined: Fri Mar 26, 2021 02:08
In-game: BagoCheese
Location: why do you care?
Contact:

Re: [Mod] Gears and axles [gear3d] [0.2] [WIP]

by Bag0Cheese » Post

I build a lot of steampunk-themed things, and this is perfect! Love it
You know the rules and so do I, SAY GOODBYE

User avatar
Extex
Member
Posts: 244
Joined: Wed Mar 14, 2018 23:14
GitHub: Extex101
In-game: Extex

Re: [Mod] Gears and axles [gear3d] [0.2] [WIP]

by Extex » Post

Perhaps some conveyor belt parts?
Creator of jelys_pizzaria and motorbike, and player of persistent kingdoms. RIP

c56
Member
Posts: 307
Joined: Wed Apr 21, 2021 03:05
GitHub: tigercoding56
In-game: bm5 or bemo5 also sell_her_on55

Re: [Mod] Gears and axles [gear3d] [0.2] [WIP]

by c56 » Post

maibe someone could make this techage compatible (like the gearboxes at ta2 )
this is a signature not a place to post messages also if i could change my username i would change it to sell_her_on55

User avatar
loppi
Member
Posts: 162
Joined: Sat May 29, 2021 11:30
In-game: loppi Lolstadt
Location: Niedersachsen,Germany

Re: [Mod] Gears and axles [gear3d] [0.2] [WIP]

by loppi » Post

nice mod! good for industrial decorations! :-D
"ich liebe industrie!" And yes, its a Russian Bulldozer 😁

User avatar
Andrey01
Member
Posts: 2574
Joined: Wed Oct 19, 2016 15:18
GitHub: Andrey2470T
In-game: Andrey01
Location: Russia, Moscow

Re: [Mod] Gears and axles [gear3d] [0.2] [WIP]

by Andrey01 » Post

Is there any progress during these last two years? I see the last commit on the github repo was on April 3rd 2019.

User avatar
loppi
Member
Posts: 162
Joined: Sat May 29, 2021 11:30
In-game: loppi Lolstadt
Location: Niedersachsen,Germany

Re: [Mod] Gears and axles [gear3d] [0.2] [WIP]

by loppi » Post

c56 wrote:
Tue Jun 29, 2021 23:11
maibe someone could make this techage compatible (like the gearboxes at ta2 )
techage has it own watermill now :)
just saw it yesterday!
"ich liebe industrie!" And yes, its a Russian Bulldozer 😁

c56
Member
Posts: 307
Joined: Wed Apr 21, 2021 03:05
GitHub: tigercoding56
In-game: bm5 or bemo5 also sell_her_on55

Re: [Mod] Gears and axles [gear3d] [0.2] [WIP]

by c56 » Post

loppi wrote:
Thu Aug 19, 2021 15:12
c56 wrote:
Tue Jun 29, 2021 23:11
maibe someone could make this techage compatible (like the gearboxes at ta2 )
techage has it own watermill now :)
just saw it yesterday!
yay =) after i asked you how to build it ( im bm5 on techage survival btw) i eventually figured out and it now works
this is a signature not a place to post messages also if i could change my username i would change it to sell_her_on55

User avatar
loppi
Member
Posts: 162
Joined: Sat May 29, 2021 11:30
In-game: loppi Lolstadt
Location: Niedersachsen,Germany

Re: [Mod] Gears and axles [gear3d] [0.2] [WIP]

by loppi » Post

cool,it can power a mill and you can grind wheat with it,its really nice.
"ich liebe industrie!" And yes, its a Russian Bulldozer 😁

User avatar
loppi
Member
Posts: 162
Joined: Sat May 29, 2021 11:30
In-game: loppi Lolstadt
Location: Niedersachsen,Germany

Re: [Mod] Gears and axles [gear3d] [0.2] [WIP]

by loppi » Post

the sprocket is a nice decorative chainsaw too!
Image
"ich liebe industrie!" And yes, its a Russian Bulldozer 😁

User avatar
Midnight
Member
Posts: 168
Joined: Sun Dec 19, 2021 13:56
GitHub: MidnightPhantom
IRC: Dragon
In-game: Dragon_Abysss
Location: Dehradun, India

Re: [Mod] Gears and axles [gear3d] [0.2] [WIP]

by Midnight » Post

Well, can anyone combine this mod with a power generator mod?

SFENCE
Member
Posts: 280
Joined: Sun Sep 29, 2019 07:13
GitHub: SFENCE
In-game: SFENCE

Re: [Mod] Gears and axles [gear3d] [0.2] [WIP]

by SFENCE » Post

Midnight wrote:
Sat Jun 03, 2023 15:42
Well, can anyone combine this mod with a power generator mod?
I have started work on it, see viewtopic.php?f=9&t=28379&hilit=gear3d or https://github.com/sfence/gear3d .
But my blender skills are not good enough to make models of broken parts. I need damaged parts models and textures to work with connected gear parts turning in the opposite way.
cdb_3P0AYqjEIn68

User avatar
Midnight
Member
Posts: 168
Joined: Sun Dec 19, 2021 13:56
GitHub: MidnightPhantom
IRC: Dragon
In-game: Dragon_Abysss
Location: Dehradun, India

Re: [Mod] Gears and axles [gear3d] [0.2] [WIP]

by Midnight » Post

Well I like that it still runs today lol.

JWTx2
New member
Posts: 1
Joined: Wed Aug 23, 2023 04:21

Re: [Mod] Gears and axles [gear3d] [0.2] [WIP]

by JWTx2 » Post

is this create's birthplace (minecraft heritage site

User avatar
Blockhead
Member
Posts: 1622
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: [Mod] Gears and axles [gear3d] [0.2] [WIP]

by Blockhead » Post

JWTx2 wrote:
Wed Aug 23, 2023 04:24
is this create's birthplace (minecraft heritage site
No this is a forum for the C++ game Minetest, which is not related to the code of any Minecraft edition. This mod is not really related to the Craft mod for Minecraft.
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests