Native coding tutorials with examples?

Discussions about Coding and Scripting
User avatar
Dizzy
Experienced
Posts: 108
Joined: Tue May 21, 2013 3:57 pm
Personal rank: Oaf

Native coding tutorials with examples?

Post by Dizzy » Tue Feb 23, 2021 9:19 pm

Do any simple tutorials exist for getting started with native coding in UT?
Image
Join our UT Discord chat server: https://www.bunnytrack.net/discord

User avatar
Gustavo6046
Godlike
Posts: 1125
Joined: Mon Jun 01, 2015 7:08 pm
Personal rank: Zeta Group leader

Re: Native coding tutorials with examples?

Post by Gustavo6046 » Tue Feb 23, 2021 11:09 pm

It's just writing C++ with the UT public headers.

User avatar
sn260591
Average
Posts: 65
Joined: Sat Jun 01, 2013 10:38 am
Location: Russia

Re: Native coding tutorials with examples?

Post by sn260591 » Wed Feb 24, 2021 8:48 am


Sapphire
Posts: 2
Joined: Tue May 16, 2017 8:17 pm

Re: Native coding tutorials with examples?

Post by Sapphire » Thu Feb 25, 2021 10:04 pm

Gustavo6046 wrote:
Tue Feb 23, 2021 11:09 pm
It's just writing C++ with the UT public headers.
Great reply. :gj:

User avatar
Dizzy
Experienced
Posts: 108
Joined: Tue May 21, 2013 3:57 pm
Personal rank: Oaf

Re: Native coding tutorials with examples?

Post by Dizzy » Thu Feb 25, 2021 10:06 pm

Gustavo6046 wrote:
Tue Feb 23, 2021 11:09 pm
It's just writing C++ with the UT public headers.
Is there not a layer of added complexity in making the code compile against and interact with UT, though?

I would love to see a simple tutorial like beginning a native mod from scratch - even as simple as writing "hello world" to the in-game chat.
Thanks, I'll take a look, although it seems like those are for Unreal classic and not UT, if that makes any difference.
Image
Join our UT Discord chat server: https://www.bunnytrack.net/discord

User avatar
Gustavo6046
Godlike
Posts: 1125
Joined: Mon Jun 01, 2015 7:08 pm
Personal rank: Zeta Group leader

Re: Native coding tutorials with examples?

Post by Gustavo6046 » Thu Feb 25, 2021 11:09 pm

Dizzy wrote:
Thu Feb 25, 2021 10:06 pm
Is there not a layer of added complexity in making the code compile against and interact with UT, though?
Kind of. UnrealScript abstracts away a lot of things, whereas in C++ you have to do a lot of stuff yourself.

I would love to see a simple tutorial like beginning a native mod from scratch - even as simple as writing "hello world" to the in-game chat.

In-game chat is an UnrealScript thing. Really, there's little reason to do most things in C++, unless you want to change something very internal about the game (like rendering), or unmediated, direct access to outside the game environment (like networking or the filesystem).
Sapphire wrote:
Thu Feb 25, 2021 10:04 pm
Gustavo6046 wrote:
Tue Feb 23, 2021 11:09 pm
It's just writing C++ with the UT public headers.
Great reply. :gj:
Apologies, that sounded quite rude. My intention was to summarize what "native modding" means. I think people exaggerate it too much, it's nothing particularly extraordinary, nor is it really all that useful. Will it be faster? Depending on what exactly you're doing, maybe. Will it be worth it? Probably not. Unless you're doing something that is performance intensive, like rendering, or something that UnrealScript (or the Unreal VM's object-oriented aspect itself) would squander too many cycles trying and end up making unbearably slow, like a particle system.

User avatar
sektor2111
Godlike
Posts: 5063
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Native coding tutorials with examples?

Post by sektor2111 » Fri Feb 26, 2021 7:38 am

I'm not going for a looong post but what I would do at C++ Level:
- making a debugger support in run-time for finding non-colliding surfaces or stupid extra colliding spots- borked geometry;
- hunting brush dimensions;
- attempting a better "Paths Build" replacement;
- bringing in stage "Level Validate" command - it doesn't work anywhere, not even in newer 469 patch;
- replacing function DescribeSpec in the way how I want it and not what 469 has;
- perhaps an advanced paths debugger - C++ can get over iterations limitation from UScript.
- C++ working linked with OS natives definitely can use multi-core support - and yes, it's faster in all the way.

User avatar
sn260591
Average
Posts: 65
Joined: Sat Jun 01, 2013 10:38 am
Location: Russia

Re: Native coding tutorials with examples?

Post by sn260591 » Fri Feb 26, 2021 11:16 am

Dizzy wrote:
Thu Feb 25, 2021 10:06 pm
Thanks, I'll take a look, although it seems like those are for Unreal classic and not UT, if that makes any difference.
At least "hello word" works for UT as well, if you use these headers and change a couple of settings in the project (tested with vs2019).

User avatar
anth
Skilled
Posts: 242
Joined: Thu May 13, 2010 2:23 am

Re: Native coding tutorials with examples?

Post by anth » Fri Feb 26, 2021 2:47 pm

The UT v432 public source distribution includes a native "hello world" mod, but the entire project needs some tweaking if you want it to work with modern versions of Visual Studio.

When 469b launches, we will publish an updated public source distribution on GitHub. These headers will work with Visual Studio 2019 and the latest versions of gcc/clang.

Aside from the sample native mod, I'm not aware of any real tutorials. You can, however, ask the OldUnreal devs for help on discord or on the native coding board @ oldunreal.com.