• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

GAF Indie Game Development Thread 2: High Res Work for Low Res Pay

Status
Not open for further replies.
I have a couple of technical questions I haven't been able to get a solid answer on.

1) Is a Mac App Developer license required to sign an app created by Game Maker Studio? I'm working on the Mac port of LOVE, and while the game works damn near flawlessly on Mac, I can't distribute it without users getting this error:
AsIKclD.png


If I have to drop the hundred bucks a year for it, fine. I just don't want to waste money if I don't have to. I wasn't planning on launching on the App Store.

2) Anyone got Steam and Linux? I need some users to test and see if LOVE runs at all. PM me if you can.
 

_machine

Member
Here's our hopefully hype-filled launch trailer:

CLICK!


The trailers have certainly been a massive undertaking us; in total it's probably taken as much time as design and production of the particle effects(with exclusion of the music).

First patch already in testing and I'm glad to say that we have at least had some youtubers/press playing the game already even though I just very recently got most of the mails sent.
 
roads2.png


Some NPC art I was fiddling with. Type of character I have the most fun designing. Collector of all kinds of gadgets and oddities.

I would enjoy just being the lead artist of a game one day rather than the everything of a game.
Reminds me of Zuckuss from Star Wars :D
 

GulAtiCa

Member
I love that some PC gamers are going out of their way to try to insult me on my Greenlight page. Really says a lot about them. but I just laugh.
 

Kalentan

Member
How do you guys feel about sprinting in Tactics RPGs?

I made this poor chart to explain what I'm speaking about:

Ky7b.png


The blue tiles are the movement and the yellow are sprint. If you move to a blue tile, you can move and take an action, whereas with the yellow you sprint to that tile but no action can be taken. Now in my game there is a perk for every character that allows them to make an action after sprinting, but what attack/skills you can use are limited if you had choosen a blue tile. You also don't have to select this perk.

Now my originally idea is to have it so that as a characters AGI goes up, the amount of blue tiles would increase and then after a point the blue tiles would no longer grow but the sprint tiles were. Do you think I should do that? Or do you think that everyones movement/sprint should stay the same at the beginning as it is at the end. Or maybe it's a perk?

[Note: Similar to X-Com, you get perks every few levels, and like it, the perk you select is locked in. Only a crystal can reset these perks, but it's costly, so your choices will most likely be locked in for quite some time.]

It should be noted that most levels in the game are large enough that sprinting at the start won't bring you into range of targets.
 
3J13yQ3.png


I really want to sit down and perfect some of this art but I ain't got time to be picky about this shit if I'm actually going to have something playable by Halloween
 
How do you guys feel about sprinting in Tactics RPGs?

Seems like a cool mechanic, it provides more strategic options for the player. It's also useful for the situation that sometimes comes up in these types of games where a character is fighting an isolated enemy, and then he has to take several turns just walking back to the main front.

Now my originally idea is to have it so that as a characters AGI goes up, the amount of blue tiles would increase and then after a point the blue tiles would no longer grow but the sprint tiles were. Do you think I should do that? Or do you think that everyones movement/sprint should stay the same at the beginning as it is at the end. Or maybe it's a perk?

Hmm, I think normal movement rate and sprinting movement rate should probably be tied so that when normal movement increases, sprinting does too. Say, sprinting allows to move up to double your movement rate or something, for a simple example.

It should be noted that most levels in the game are large enough that sprinting at the start won't bring you into range of targets.

Hmm, is that really a good idea though? I kinda feel that if it takes several turns just to get to the enemy, that's wasting the player's time a bit, unless there are really compelling choices to be made in the early movement turns...
 

Kalentan

Member
Hmm, I think normal movement rate and sprinting movement rate should probably be tied so that when normal movement increases, sprinting does too. Say, sprinting allows to move up to double your movement rate or something, for a simple example.

So if AGI was high enough, the blue tiles would add another layer and so would the sprint?

Hmm, is that really a good idea though? I kinda feel that if it takes several turns just to get to the enemy, that's wasting the player's time a bit, unless there are really compelling choices to be made in the early movement turns...

Poorly worded, I meant to make it seem like the stages aren't so small that sprinting once already gets you into range of enemies from turn 1. Though this sort of determines on the stage, since that might be the case in some levels.
 
That's what I call juicy (love the death animation too)! I can't say I see why that would need any tweaking whatsoever :)

It's mainly just that the heat streaks flaring out are clipping in the bottom of the pod,(as seen more clearly here):

http://i.imgur.com/WF3JQen.gifv

And we want to have some 3D geometry actually jut upwards out of the ground on impact. but apart from that, I'm really pleased with what Cory's done!
 

Dewfreak83

Neo Member
Question: at a convention, if you stop by a booth that's busy, and are told you'll have to wait a little bit to play, how long are you willing to wait?

I wonder if it's worth implementing a feature in the Lupinball demo to allow players to "hot-join" games. It wouldn't make sense in the final game, but if people are unwilling to wait at conventions I want to give them an opportunity to play immediately if there's an unused slot in an ongoing game.

I've showed my game off at 3 conventions so far. The average play-through is around 15 minutes. Some taking as long as 20 minutes (depending how fast they read / strategize). There is an end to the demo, and also multiple places the player could stop playing if they wanted too - but most would play until the end: So have one!

Almost everyone waited to play at one of the 3 stations.

Some folks would play multiple times - and I would have to awkwardly ask them to let others play. Just prepare for that!

It also helped having a pitch to get folks interested. Those waiting could also watch a demo video playing and look over a brochure.

Get a mailing list going! Some would sign it before they even played the game, and the few who didn't stick around put their names on it anyways!

Also get at least one other person to help you. You'll need to go to the bathroom at some point, but more importantly you may have interviews. Nice to have someone to help players while you are pitching as well!

geX0Qti.jpg
 

Ventron

Member
I've showed my game off at 3 conventions so far. The average play-through is around 15 minutes. Some taking as long as 20 minutes (depending how fast they read / strategize). There is an end to the demo, and also multiple places the player could stop playing if they wanted too - but most would play until the end: So have one!

Almost everyone waited to play at one of the 3 stations.

Some folks would play multiple times - and I would have to awkwardly ask them to let others play. Just prepare for that!

It also helped having a pitch to get folks interested. Those waiting could also watch a demo video playing and look over a brochure.

Get a mailing list going! Some would sign it before they even played the game, and the few who didn't stick around put their names on it anyways!

Also get at least one other person to help you. You'll need to go to the bathroom at some point, but more importantly you may have interviews. Nice to have someone to help players while you are pitching as well!

geX0Qti.jpg

Cool advice man! I printed out Lupinball cards rather than brochures, does one work better than the other?

I plan on having an tablet set up on our mailing list signup page, but some also suggested paper sheets as its faster to write emails down. So I'll probably have both in case someone is busy on the tablet.

I will have one other person at PAX Aus, I was by myself at my first, much smaller convention and that was bothersome (and just one day!). Yeah, definitely have a helper.
 

Dewfreak83

Neo Member
Cool advice man! I printed out Lupinball cards rather than brochures, does one work better than the other?

I plan on having an tablet set up on our mailing list signup page, but some also suggested paper sheets as its faster to write emails down. So I'll probably have both in case someone is busy on the tablet.

I will have one other person at PAX Aus, I was by myself at my first, much smaller convention and that was bothersome (and just one day!). Yeah, definitely have a helper.

Honestly, you'll just want to go for the cheaper (but still decent-quality option). From my experience, 80-90% will throw away your material or just forget it all together. That's why the mailing list is so important - it really is up to you to reach back out to them!

I had a written list - two of them with clipboards. I would suggest having both digital and written! About 20 to 30 of the names I just couldn't legible read, which was a real shame! I think the barrier to writing vs typing is lower - but that is pure opinion. Also some horror stories about losing digital mailing lists made me nervous.

Also have business cards to hand out to other developers and press. Good luck!
 

Ventron

Member
Honestly, you'll just want to go for the cheaper (but still decent-quality option). From my experience, 80-90% will throw away your material or just forget it all together. That's why the mailing list is so important - it really is up to you to reach back out to them!

I had a written list - two of them with clipboards. I would suggest having both digital and written! About 20 to 30 of the names I just couldn't legible read, which was a real shame! I think the barrier to writing vs typing is lower - but that is pure opinion. Also some horror stories about losing digital mailing lists made me nervous.

Also have business cards to hand out to other developers and press. Good luck!

I've heard about handwriting problems in the past. That's why I'm going to print out sheets like forms:

|_|_|_|_|_|_|_|_|_|_|_|

And force people to write in block letters! Mwahahahaha
 

Kalentan

Member
Hey guys so I need some help with my code as I have finally got it so my AI can move towards me... but only very specifically...

edit: problem updated and continued 5 posts down.

Code:
   globalvar n;
   n = 0;
   for (var xx = 0; xx < ds_grid_width(grid2); xx++)
    {
        for (var yy = 0; yy < ds_grid_height(grid2); yy++)
            {
                if (ds_grid_get(grid2, xx, yy) == 4)
                    {
                    heroX = xx;
                    heroY = yy;
                    }
            }
    }
    for (var xx = 0; xx < ds_grid_width(grid2); xx++)
    {
        for (var yy = 0; yy < ds_grid_height(grid2); yy++)
            {
                if (ds_grid_get(grid2, xx, yy) == 2)
                    {
                    globalvar distance;
                    distance = floor(point_distance(xx, yy, heroX, heroY))
                    if (distance > n)
                        {
                        movX = xx*58;
                        movY = yy*77;
                        break;
                        }
                    if (distance < n)
                        {
                        n++
                        } 
                    }
            }
    }
    
    alarm[2] = 120;

So whats wrong with it? A lot.

So what it's supposed to do is check every instance that ds_grid is 2 and then checks it's distance to the heroX and heroY. Problem is?

What the characters do in game make no fucking sense. If the first enemy will move AWAY from the target. So rather picking the first instance that distance <= n, it picks the spot that is farthest away. Same with enemy2.

Then if I say change the signs, make them... if (distance >= n), and if (distance > n) then enemy2 loses his fucking mind. It doesn't run a script which changes the nearby ground cells in ds_grid to 2 (despite distance and n having NOTHING to do with that script activating, worse, it actually shows that it processes the code around the portion that calls the script), and then it completely skips the checking distance phase until it claims that it finishes it's moves.

u17b.png


So in this picture, the enemies will both move in the direction of the white arrows, instead of in the direction of the red arrows.
 

GulAtiCa

Member
Decided to update the trailer for my Greenlight page by just showing the title screen and just the main gameplay for a quick 1 minute trailer. I speed up the gameplay a good bit too, which works better cause the regular 1X speed is rather slow... Esp since people people play at the faster speeds anyways, so this looks better. I think this should help.
 

Granadier

Is currently on Stage 1: Denial regarding the service game future
I have a couple of technical questions I haven't been able to get a solid answer on.

1) Is a Mac App Developer license required to sign an app created by Game Maker Studio? I'm working on the Mac port of LOVE, and while the game works damn near flawlessly on Mac, I can't distribute it without users getting this error:
AsIKclD.png


If I have to drop the hundred bucks a year for it, fine. I just don't want to waste money if I don't have to. I wasn't planning on launching on the App Store.

2) Anyone got Steam and Linux? I need some users to test and see if LOVE runs at all. PM me if you can.

Yes, you will need a developer license to sign your application and distribute it on the Mac App store.

If you want to distribute it yourself there are ways around the developer license for signing. Apples official docs state that you need a license though.
https://developer.apple.com/library...sOutside/DistributingApplicationsOutside.html

Here is a link for creating your own signing certificate for your app. I'm not sure if this flags Gatekeeper or not.
http://stackoverflow.com/questions/...n-the-mac-developer-program/27474942#27474942
 

Kitbash

Member
What the characters do in game make no fucking sense. If the first enemy will move AWAY from the target. So rather picking the first instance that distance <= n, it picks the spot that is farthest away. Same with enemy2.

Edit: Nevermind, I misread the code! Sorry.
 
Started work on another project awhile ago and I seem to have gotten farther mechanically on this project than on my other one. Bleh, as much as I want to keep working on one project I burn out and start working on another. At least this one is simple on presentation and just way heavier on the text.
 

Kalentan

Member
Edit: Nevermind, I misread the code! Sorry.

No problem. Though I did go a bit further with my code...

Code:
   globalvar n;
   n = 0;
   for (var xx = 0; xx < ds_grid_width(grid2); xx++)
    {
        for (var yy = 0; yy < ds_grid_height(grid2); yy++)
            {
                if (ds_grid_get(grid2, xx, yy) == 4)
                    {
                    heroX = xx;
                    heroY = yy;
                    }
            }
    }
    for (var xx = 0; xx < ds_grid_width(grid2); xx++)
    {
        for (var yy = 0; yy < ds_grid_height(grid2); yy++)
            {
                 globalvar distance;
                 distance = floor(point_distance(xx, yy, heroX, heroY))
                 if (ds_grid_get(grid2, xx, yy) == 2)
                    {
                    if (n <= distance)
                        {
                        global.movX = xx*58;
                        global.movY = yy*77;
                        break;
                        }
                    else
                        {
                        n++
                        } 
                    }
            }
    }
    
    alarm[2] = 120;

I've discovered the problem.

It's always going to stop at the very last instance of ds_grid_get(grid2, xx,yy) == 2.

I'm not sure why, but I noticed it. In the new code, I made it so it's possible to go left, but only if there is no spots right. It's... weird. I'm unsure of what is causing it.

Edit: Okay, so I added 2 distances and got rid of n. 1 distance var which calculates the distance between the enemy and the player, and the other one calculates the distance between a ds_grid and the player. It then moves to the first ds_grid == 2 that's distance is less than the distance1. So I did this and I even got it to go in the direction I want! But here's the weird thing... If I place the player to the right of the enemy, he will move to the end.

t27b.png


In this picture I edited it to add another player, but in reality there is only one. However if you look at them, it's clear if the player is on the left, the enemy should move all the way to the left, but he will only move one. If the hero is on the right, the enemy should move only right 1 over, but instead the enemy moves down to the end. Why?

edit 2: I'm a big fat fucking idiot. I was trying to get out of a if statement and the entire loop by using a break... all I needed to change it to an exit and it fixed the problem... fml.
 

Blizzard

Banned
I suppose I had escaped major programming curveballs for a bit, until I encountered 3 new things in the last few days.

1. The joys of COM (https://msdn.microsoft.com/en-us/library/windows/desktop/ms680573(v=vs.85).aspx). All I wanted was to get a single number from Windows that relates to audio. Instead I got to learn about initializing / uninitializing COM, the reference counts it uses and how you call Release but not AddRef (usually), the various cast shenanigan(s) involved, etc. just so I can query a property page. I'm still not done with that.

2. C++ and pointers to class members (http://stackoverflow.com/questions/670734/c-pointer-to-class-data-member). Check the second answer from the top for an amusing use. I might have seen this before and then blocked it from my memory. It might be able to do some clever things, but it also seems like a way to make really confusing code.

3. C++11 and move constructors / move assignment operators (https://msdn.microsoft.com/en-us/library/dd293665.aspx). This lets you use a funky-looking syntax to gain some efficiency in some cases.
 
I have a couple of technical questions I haven't been able to get a solid answer on.

1) Is a Mac App Developer license required to sign an app created by Game Maker Studio? I'm working on the Mac port of LOVE, and while the game works damn near flawlessly on Mac, I can't distribute it without users getting this error:
AsIKclD.png


If I have to drop the hundred bucks a year for it, fine. I just don't want to waste money if I don't have to. I wasn't planning on launching on the App Store.

2) Anyone got Steam and Linux? I need some users to test and see if LOVE runs at all. PM me if you can.
o

Late reply but I think that can be fixed in security settings. I think set it to open all applications from all locations to fix. Ran into same problem n my liscense was expired at the time but got it fixed. I might be wrong about what to do though.

In other things my app "_ Howler _" releases on Thursday the 15th ^_^ once I get iOS codes out to press I'll possibly send u guys codes.
 

Bloodember

Member
Here's our hopefully hype-filled launch trailer:

CLICK!


The trailers have certainly been a massive undertaking us; in total it's probably taken as much time as design and production of the particle effects(with exclusion of the music).

First patch already in testing and I'm glad to say that we have at least had some youtubers/press playing the game already even though I just very recently got most of the mails sent.

Game looks awesome, will have to pick it up sometime.
 
Here's our hopefully hype-filled launch trailer:

CLICK!


The trailers have certainly been a massive undertaking us; in total it's probably taken as much time as design and production of the particle effects(with exclusion of the music).

First patch already in testing and I'm glad to say that we have at least had some youtubers/press playing the game already even though I just very recently got most of the mails sent.

Looks most excellent! Congrats!
 

Yoshi

Headmaster of Console Warrior Jugendstrafanstalt

first for-loop: find grid position of element of value 4 and save its coordinates in (herox,heroy)

the second for-loop looks for the smallest distance of any point on the map (xx,yy) from (herox, heroy), I guess in the Euclidian space that has value 2?

I guess, if I understand your code correctly (please, comment what you want to do and what the variables mean), then if the grid value is 2, then it is a position that is free on the grid, if it is 4, then the hero is standing there, (global.movx, global.movy) is the selected goal position. Now observe that floor always takes the greatest int that is smaller than a given floating point value. So if you are to the top left of the hero and begin search than the smallest value n can take such that ds_grid_get(grid2, xx, yy) == 2 is 1 (because distance 0 is only reached in the position the hero occupies), this is being reached for the first time in your for-loop on the top left corner, if you use euclidian distance measure, because sqrt(1^2+1^2)=sqrt(2) which is in the interval [1,2[ and thus ceil of that is 1. You'd need to use the manhattan distance for this to work reliably.
 
I've been giving my game Stage Presence a lick of paint in preperation for the Steam launch. Pretty happy with the new colour grading and high contrast - shamelessly cribbed from Sunset and Firewatch. Those games are too beautiful not to steal from. I increased the harshness of the contrast to fit the feel of Stage Presence.

Now I just need to finish up the multiplayer mode where you invade other peoples games as a crowd member and get to hurl abuse at them and it'll be ready for Steam!

 

Water

Member
I suppose I had escaped major programming curveballs for a bit, until I encountered 3 new things in the last few days.
...
3. C++11 and move constructors / move assignment operators (https://msdn.microsoft.com/en-us/library/dd293665.aspx). This lets you use a funky-looking syntax to gain some efficiency in some cases.
Move constructors are a fundamental feature in modern C++. Not many people need to constantly write their own, but I'd say being aware of them is a part of basic competency in the language. People who are good at old C++ but don't know move constructors and the other modern stuff will write much uglier code because it used to be required for good performance. You can see the difference in even very simple, common pieces of code.
 
I've been giving my game Stage Presence a lick of paint in preperation for the Steam launch. Pretty happy with the new colour grading and high contrast - shamelessly cribbed from Sunset and Firewatch. Those games are too beautiful not to steal from. I increased the harshness of the contrast to fit the feel of Stage Presence.

Now I just need to finish up the multiplayer mode where you invade other peoples games as a crowd member and get to hurl abuse at them and it'll be ready for Steam!


This game sounds hilarious! Definitely giving this a try once it's on Steam :)
 

Kalentan

Member
first for-loop: find grid position of element of value 4 and save its coordinates in (herox,heroy)

the second for-loop looks for the smallest distance of any point on the map (xx,yy) from (herox, heroy), I guess in the Euclidian space that has value 2?

I guess, if I understand your code correctly (please, comment what you want to do and what the variables mean), then if the grid value is 2, then it is a position that is free on the grid, if it is 4, then the hero is standing there, (global.movx, global.movy) is the selected goal position. Now observe that floor always takes the greatest int that is smaller than a given floating point value. So if you are to the top left of the hero and begin search than the smallest value n can take such that ds_grid_get(grid2, xx, yy) == 2 is 1 (because distance 0 is only reached in the position the hero occupies), this is being reached for the first time in your for-loop on the top left corner, if you use euclidian distance measure, because sqrt(1^2+1^2)=sqrt(2) which is in the interval [1,2[ and thus ceil of that is 1. You'd need to use the manhattan distance for this to work reliably.

Sorry, should have made the edit at top of the post. It's been fixed. The problem was that I was never exiting out of the loop correctly.
 

anteevy

Member
We are out now on Steam!

http://store.steampowered.com/app/349840/




I can hardly believe we're there now, but I really want to thank you all so much for the support, it's really been a long road and as you all now game development is always easy, so speaking to such a fantastic, like-minded community has really helped us a lot :)
Awesome, congrats and good luck!

I've been giving my game Stage Presence a lick of paint in preperation for the Steam launch. Pretty happy with the new colour grading and high contrast - shamelessly cribbed from Sunset and Firewatch. Those games are too beautiful not to steal from. I increased the harshness of the contrast to fit the feel of Stage Presence.

Now I just need to finish up the multiplayer mode where you invade other peoples games as a crowd member and get to hurl abuse at them and it'll be ready for Steam!

I remember this, I believe we were on Greenlight at the same time. :D Looks fun and crazy.
 

Kalentan

Member
I did it! I got it so my AI will actually select a target and move to it.

How does it do it?

Well, it first determines which target it should move to. First the enemy checks its distance from the player characters. Then if the distance is the same for multiple characters towards the enemy, it then checks what the health is of each enemy. Okay, so if the health for each of them are equal, then it checks the class of each character. The class is a number, and the lower the number, the higher priority that target has. Since there is 8 characters, it goes from 1 to 8.

While I'm still not sure what I'm going to do about skills that the enemy use, but I think I can use the similar code for determining who to attack.

Edit: I actually got it so the enemy can attack and even ends his movement if he can't attack or move anymore.
 

Blizzard

Banned
Move constructors are a fundamental feature in modern C++. Not many people need to constantly write their own, but I'd say being aware of them is a part of basic competency in the language. People who are good at old C++ but don't know move constructors and the other modern stuff will write much uglier code because it used to be required for good performance. You can see the difference in even very simple, common pieces of code.
I don't use C++11 features often, which probably has a decent amount to do with my work history doing embedded system / drivers or other development with older hardware and development environments.

Are you referring to implicitly-generated move constructors/assignment operators? I did a brief search which suggests there was some disagreement over when they would be created and I don't know what the final standard said about it.
 

Kalentan

Member
Hey guys, so what do you think I should do about ranged attack animations?

So say I have a enemy with a sword and he attacks the character to the left of them. The left version of the animation will play out but the enemy sprite will never physically come into contact with the character he attacked.

So what if I have an archer? Does the arrow just shoot and then vanish and then there's just a damaged animation on the character hit?

But then what about a spell like shooting a fire ball? Does the fire ball travel or just vanish until it hits the target?
 

Water

Member
I don't use C++11 features often, which probably has a decent amount to do with my work history doing embedded system / drivers or other development with older hardware and development environments.

Are you referring to implicitly-generated move constructors/assignment operators? I did a brief search which suggests there was some disagreement over when they would be created and I don't know what the final standard said about it.
One example of what I'm thinking of is: how would you write a function that takes some huge data structure as an argument, and is supposed to produce a slightly altered copy of it? Is this the best we can do for code cleanliness while not sacrificing performance?
Code:
void copy_and_alter(const vector<stuff>& source, vector<stuff>& dest) {...}
// and at every call site:
vector<stuff> altered;
copy_and_alter(old_data, altered);
 
We are out now on Steam!

http://store.steampowered.com/app/349840/




I can hardly believe we're there now, but I really want to thank you all so much for the support, it's really been a long road and as you all now game development is always easy, so speaking to such a fantastic, like-minded community has really helped us a lot :)
Congrats, colour me envious XD
Hope it all goes great :3

Just throwing this out there but have you considered making one of the buttons dedicated to an action and letting players switch what the other does? (e.g. right click is always move or look while the left can be toggled between the remaining two actions)
I know you're aiming to make a game based off an old-skool game but a little bit of streamlining surely can't hurt :3
 

Blizzard

Banned
One example of what I'm thinking of is: how would you write a function that takes some huge data structure as an argument, and is supposed to produce a slightly altered copy of it? Is this the best we can do for code cleanliness while not sacrificing performance?
Code:
void copy_and_alter(const vector<stuff>& source, vector<stuff>& dest) {...}
// and at every call site:
vector<stuff> altered;
copy_and_alter(old_data, altered);
What I meant was, you said "Not many people need to constantly write their own". Do you mean there is a way to use move without writing your own move constructor/assignment methods?

And in regard to your code example, it depends on what you want to do. Is the original huge data structure supposed to be untouched (the const would suggest so)? If so, how is there any logical way to avoid copying the entire data structure no matter what mechanism is used?

Apologies if I'm missing your point.
 

Water

Member
What I meant was, you said "Not many people need to constantly write their own". Do you mean there is a way to use move without writing your own move constructor/assignment methods?
I just mean if you know what move constructors do in the language, you can take advantage of move constructors others have written. For one, virtually everything in the standard library is movable.

And in regard to your code example, it depends on what you want to do. Is the original huge data structure supposed to be untouched (the const would suggest so)? If so, how is there any logical way to avoid copying the entire data structure no matter what mechanism is used?
One copy is unavoidable, after all that was part of the stated purpose of the function. The question was whether you can make the code cleaner without sacrificing performance. For instance, would this work?
Code:
vector<stuff> copy_and_alter(vector<stuff> source) { ... }
// at call site
auto altered = copy_and_alter(old_data);
 
Status
Not open for further replies.
Top Bottom